mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-04 20:14:57 +08:00
Add function to check the billing status
This commit is contained in:
parent
033e24f7f0
commit
8887ded506
1 changed files with 12 additions and 0 deletions
|
@ -172,6 +172,14 @@ defmodule Livebook.Hubs.TeamClient do
|
|||
GenServer.call(registry_name(id), {:user_can_deploy?, user_id, deployment_group_id})
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns if the Livebook Teams organization billing status is in good standing.
|
||||
"""
|
||||
@spec billing_good_standing?(String.t()) :: boolean()
|
||||
def billing_good_standing?(id) do
|
||||
GenServer.call(registry_name(id), :billing_good_standing?)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns if the Team client is connected.
|
||||
"""
|
||||
|
@ -370,6 +378,10 @@ defmodule Livebook.Hubs.TeamClient do
|
|||
end
|
||||
end
|
||||
|
||||
def handle_call(:billing_good_standing?, _caller, state) do
|
||||
{:reply, not state.hub.billing_status.disabled, state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_info(:connected, state) do
|
||||
Hubs.Broadcasts.hub_connected(state.hub.id)
|
||||
|
|
Loading…
Add table
Reference in a new issue