From ec5943a2cf848e1d03a2af5fc2bbfb611fd79881 Mon Sep 17 00:00:00 2001 From: Tobiah Date: Sat, 18 Mar 2023 13:36:29 -0500 Subject: [PATCH] fix(logs): set a startup timeout, set some logs to debug --- src/eventHandlers/Ready.js | 5 ++++- src/notifications/Broadcaster.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/eventHandlers/Ready.js b/src/eventHandlers/Ready.js index c3705bb1f..99b4eb672 100644 --- a/src/eventHandlers/Ready.js +++ b/src/eventHandlers/Ready.js @@ -20,9 +20,12 @@ const max = { const cycleTimeout = 60000; +const startupTimeout = Number.parseInt(process.env.READY_FORCE || '3600000', 10); + export default class OnReadyHandle extends Handler { constructor(bot) { super(bot, 'handlers.onReady', Events.CLIENT_READY); + setTimeout(this.execute.bind(this), startupTimeout); } async execute() { @@ -32,7 +35,7 @@ export default class OnReadyHandle extends Handler { await this.#notifyUp(); this.settings.init(); - await this.settings.ensureData(this.client); + // await this.settings.ensureData(this.client); this.bot.readyToExecute = true; await this.#updatePresence(); diff --git a/src/notifications/Broadcaster.js b/src/notifications/Broadcaster.js index b2c418b5a..418a0ac45 100644 --- a/src/notifications/Broadcaster.js +++ b/src/notifications/Broadcaster.js @@ -54,7 +54,7 @@ export default class Broadcaster { ? this.workerCache.getKey(`${type}:${platform}:${locale}`) : await this.settings.getAgnosticNotifications({ type, platform, items, locale }); if (!channels?.length) { - logger.error(`No channels on ${platform}:${locale} tracking ${type}... continuing`, 'WS'); + logger.debug(`No channels on ${platform}:${locale} tracking ${type}... continuing`, 'WS'); return; }