[skip ci] fix: startup issues in gateway

This commit is contained in:
Hampus Kraft 2026-02-18 16:53:32 +00:00
parent fda2962148
commit 22ba6945ed
No known key found for this signature in database
GPG Key ID: 6090864C465A454D
2 changed files with 10 additions and 2 deletions

View File

@ -25,6 +25,7 @@ start(_StartType, _StartArgs) ->
otel_metrics:init(),
passive_sync_registry:init(),
guild_counts_cache:init(),
{ok, Pid} = fluxer_gateway_sup:start_link(),
Port = fluxer_gateway_env:get(port),
Dispatch = cowboy_router:compile([
{'_', [
@ -37,7 +38,7 @@ start(_StartType, _StartArgs) ->
env => #{dispatch => Dispatch},
max_frame_size => 4096
}),
fluxer_gateway_sup:start_link().
{ok, Pid}.
-spec stop(term()) -> ok.
stop(_State) ->

View File

@ -67,7 +67,7 @@ handle_presence_connect(Attempt, State) ->
group_dm_recipients => GroupDmRecipients,
custom_status => maps:get(custom_status, State, null)
}},
case gen_server:call(presence_manager, Message, 5000) of
try gen_server:call(presence_manager, Message, 5000) of
{ok, Pid} ->
try_presence_session_connect(
Pid,
@ -83,6 +83,13 @@ handle_presence_connect(Attempt, State) ->
);
_ ->
schedule_presence_retry(Attempt, State)
catch
exit:{noproc, _} ->
schedule_presence_retry(Attempt, State);
exit:{normal, _} ->
schedule_presence_retry(Attempt, State);
_:_ ->
schedule_presence_retry(Attempt, State)
end.
-spec try_presence_session_connect(