Skip to content

Commit

Permalink
fix(loop): not breaking loop on DISCORD_SESSION_SHUTDOWN
Browse files Browse the repository at this point in the history
This commit fixes an issue that the discord-loop loop wouldn't be breaken to reconnect, causing the bot to be stuck in the state of disconnected.

Co-authored-by: Lucas Müller <[email protected]>
  • Loading branch information
ThePedroo and lcsmuller committed Jan 26, 2024
1 parent 6c50c70 commit 88a1500
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/discord-loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ discord_run(struct discord *client)
(void)poll_errno;
}

if (client->gw.session->status & DISCORD_SESSION_SHUTDOWN) break;

BREAK_ON_FAIL(code, io_poller_perform(client->io_poller));

discord_requestor_dispatch_responses(&client->rest.requestor);
Expand Down

0 comments on commit 88a1500

Please sign in to comment.