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

Commit

Permalink
Do not preserve the session on graceful shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
HanabishiRecca committed May 25, 2023
1 parent b8fadb9 commit b17c6ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bot/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ client.on(ClientEvents.WARN, Logger.Warn);
client.on(ClientEvents.ERROR, Logger.Error);
client.on(ClientEvents.FATAL, Shutdown);

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

0 comments on commit b17c6ef

Please sign in to comment.