From ed580e6eddb72a82a9bbb079dc744d1cdf8dabb5 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 1 May 2021 22:06:20 -0500 Subject: [PATCH] Attempt to fix hang on CI on GitHub --- bot/awesomescibo.mjs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/bot/awesomescibo.mjs b/bot/awesomescibo.mjs index 6da91f5..5ec615d 100755 --- a/bot/awesomescibo.mjs +++ b/bot/awesomescibo.mjs @@ -17,20 +17,22 @@ const helpMessage = client.once("ready", () => { // Connect to MongoDB using mongoose - mongoose - .connect(process.env.MONGO_URI, { - useUnifiedTopology: true, - useNewUrlParser: true, - }) - .then(() => { - // Log client tag and set status - console.log(`Logged in as: ${client.user.username}!`); - client.user.setActivity( - 'for "do be helping" | Add me to your own server: adat.link/awscibo', - { type: "WATCHING" } - ); - }) - .catch((err) => console.log(err)); + if (!process.env.CI) { + mongoose + .connect(process.env.MONGO_URI, { + useUnifiedTopology: true, + useNewUrlParser: true, + }) + .then(() => { + // Log client tag and set status + console.log(`Logged in as: ${client.user.username}!`); + client.user.setActivity( + 'for "do be helping" | Add me to your own server: adat.link/awscibo', + { type: "WATCHING" } + ); + }) + .catch((err) => console.log(err)); + } }); client.on("guildCreate", (guild) => {