mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-10 15:04:25 +08:00
Check if deployment group belongs to app server
This commit is contained in:
parent
c1dc817122
commit
afdc6f080c
1 changed files with 12 additions and 0 deletions
|
@ -166,6 +166,14 @@ defmodule Livebook.Hubs.TeamClient do
|
|||
GenServer.call(registry_name(id), :authorization_groups_enabled?)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns if the Team client is an app server for given deployment group.
|
||||
"""
|
||||
@spec current_app_server_deployment_group?(String.t(), String.t()) :: boolean()
|
||||
def current_app_server_deployment_group?(id, deployment_group_id) do
|
||||
GenServer.call(registry_name(id), {:current_deployment_group?, deployment_group_id})
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns if the Team client is connected.
|
||||
"""
|
||||
|
@ -346,6 +354,10 @@ defmodule Livebook.Hubs.TeamClient do
|
|||
end
|
||||
end
|
||||
|
||||
def handle_call({:current_deployment_group?, id}, _caller, state) do
|
||||
{:reply, state.deployment_group_id == id, 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