fix(gateway): notify clients by role in the shutdown drain

This commit is contained in:
Hampus committed 2026-10-24 20:55:23 +02:00
1 parent d5235af213
commit 25886e4fcc
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.