From 53265a920741d71a90795578cea4eec94c1b54e7 Mon Sep 17 00:00:00 2001 From: cobalt <61329810+RedGuy12@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:35:58 -0500 Subject: [PATCH] Fix CDBL Signed-off-by: cobalt <61329810+RedGuy12@users.noreply.github.com> --- .github/workflows/deploy.yml | 3 +++ common/database.ts | 1 + modules/reminders/send.ts | 2 +- web/server.ts | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7eab11505..9199316b3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,6 +41,9 @@ jobs: curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST }}/raw/strings.ts" --output common/strings.ts + - name: Touch .env + run: touch .env + - name: Checkout images run: git clone https://gist.github.com/${{ secrets.IMAGES_GIST }}.git .private/images diff --git a/common/database.ts b/common/database.ts index 2c096a435..3d6fa97e9 100644 --- a/common/database.ts +++ b/common/database.ts @@ -198,6 +198,7 @@ export async function cleanListeners(): Promise { export async function prepareExit(): Promise { await cleanListeners(); client.user.setStatus("dnd"); + process.emitWarning("prepare-exit called"); await client.destroy(); } diff --git a/modules/reminders/send.ts b/modules/reminders/send.ts index d507bef8f..5ad31b29c 100644 --- a/modules/reminders/send.ts +++ b/modules/reminders/send.ts @@ -134,8 +134,8 @@ async function sendReminders(): Promise { continue; } case SpecialReminders.RebootBot: { - await prepareExit(); process.emitWarning(`${client.user.tag} is killing the bot`); + await prepareExit(); process.exit(1); // Fake “fall-through” since ESLint doesn’t realize this is unreacahble } diff --git a/web/server.ts b/web/server.ts index 8e1bd2f4e..03878a03d 100644 --- a/web/server.ts +++ b/web/server.ts @@ -45,7 +45,6 @@ const server = http.createServer(async (request, response) => { .end("403 Forbidden"); await prepareExit(); - process.emitWarning("prepare-exit called"); response.writeHead(200, { "content-type": "text/plain" }).end("200 OK"); return;