From 4b7b43c036612a587b78ca644cd2c23528cc287e Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 6 Jan 2024 09:27:09 +0000 Subject: [PATCH] add finisheding msg --- src/index.ts | 3 +++ src/server/serverManager.ts | 4 ++-- src/website/websiteManager.ts | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index fa7554b..43c7ea6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ import Influx from "./influx/influx"; import ServerManager from "./server/serverManager"; import WebsiteManager from "./website/websiteManager"; +import {logger} from "./utils/logger"; /** * The influx database instance. @@ -9,3 +10,5 @@ export const influx = new Influx(); new ServerManager(); new WebsiteManager(); + +logger.info("Done loading!"); \ No newline at end of file diff --git a/src/server/serverManager.ts b/src/server/serverManager.ts index d5c6d8b..a86a727 100644 --- a/src/server/serverManager.ts +++ b/src/server/serverManager.ts @@ -20,8 +20,8 @@ export default class ServerManager { } logger.info(`Loaded ${this.servers.length} servers!`); - cron.schedule(Config.pinger.pingCron, () => { - this.pingServers(); + cron.schedule(Config.pinger.pingCron, async () => { + await this.pingServers(); }); cron.schedule(Config.pinger.dnsInvalidationCron, () => { diff --git a/src/website/websiteManager.ts b/src/website/websiteManager.ts index 6f89994..ae18d00 100644 --- a/src/website/websiteManager.ts +++ b/src/website/websiteManager.ts @@ -19,8 +19,8 @@ export default class WebsiteManager { } logger.info(`Loaded ${this.websites.length} websites!`); - cron.schedule(Config.pinger.pingCron, () => { - this.pingWebsites(); + cron.schedule(Config.pinger.pingCron, async () => { + await this.pingWebsites(); }); }