mirror of
https://github.com/fluxerapp/fluxer.git
synced 2026-11-30 22:23:12 -08:00
fix(gateway): notify clients by role in the shutdown drain
This commit is contained in:
2 files changed
+3
-6
No files matched your search
@@ -4,7 +4,7 @@
|
||||
-typing([eqwalizer]).
|
||||
-behaviour(gen_server).
|
||||
|
||||
-export([start_link/0, drain_async/0, undrain/0, diagnostic_info/0]).
|
||||
-export([start_link/0, drain_async/0, drain_notify_role/0, undrain/0, diagnostic_info/0]).
|
||||
-export([
|
||||
init/1,
|
||||
handle_call/3,
|
||||
|
||||
@@ -17,10 +17,7 @@ run() ->
|
||||
-spec drain() -> ok.
|
||||
drain() ->
|
||||
persistent_term:put({fluxer_gateway, draining}, true),
|
||||
Result = shard_utils:safe_apply(
|
||||
fun session_manager:reconnect_drain/0,
|
||||
{error, unavailable}
|
||||
),
|
||||
logger:info("Gateway shutdown drain: ~p", [Result]),
|
||||
ok = gateway_cluster_handoff:drain_notify_role(),
|
||||
logger:info("Gateway shutdown drain: notified clients"),
|
||||
timer:sleep(?FRAME_FLUSH_MS),
|
||||
ok.
|
||||
Reference in new issue
Block a user