Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Preserve the session on graceful shutdown again
Browse files Browse the repository at this point in the history
  • Loading branch information
HanabishiRecca committed Jun 6, 2023
1 parent dc3db3b commit 9153a0f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bot/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ client.on(ClientEvents.WARN, Logger.Warn);
client.on(ClientEvents.ERROR, Logger.Error);
client.on(ClientEvents.FATAL, Shutdown);

process.on("exit", (code) => {
if (code == 0) return;
process.on("exit", () => {
const { session } = client;
if (!session) return;
writeFileSync(SESSION_FILE, `${session.id}\n${session.seq}`, {
Expand Down

0 comments on commit 9153a0f

Please sign in to comment.