From 0fbea0cb4e9c5d968f56990462f70e7fdb822cb6 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 30 Dec 2023 23:54:53 +0000 Subject: [PATCH] update default connection timeout --- config.json | 2 +- lib/database.js | 4 ---- lib/ping.js | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/config.json b/config.json index e80e60e..f28590d 100644 --- a/config.json +++ b/config.json @@ -5,7 +5,7 @@ }, "rates": { "pingAll": 15000, - "connectTimeout": 2500 + "connectTimeout": 10000 }, "oldPingsCleanup": { "enabled": false, diff --git a/lib/database.js b/lib/database.js index 99d4be2..ee517c4 100644 --- a/lib/database.js +++ b/lib/database.js @@ -239,7 +239,6 @@ class Database { // Record not found if (data[0] === undefined) { - // eslint-disable-next-line node/no-callback-literal callback(false); return; } @@ -248,7 +247,6 @@ class Database { const timestamp = data[0].timestamp; // Allow null player counts and timestamps, the frontend will safely handle them - // eslint-disable-next-line node/no-callback-literal callback(true, playerCount, timestamp); } ); @@ -272,10 +270,8 @@ class Database { // Allow null timestamps, the frontend will safely handle them // This allows insertion of free standing records without a known timestamp if (playerCount !== null) { - // eslint-disable-next-line node/no-callback-literal callback(true, playerCount, timestamp); } else { - // eslint-disable-next-line node/no-callback-literal callback(false); } } diff --git a/lib/ping.js b/lib/ping.js index d73b55d..cfccfdc 100644 --- a/lib/ping.js +++ b/lib/ping.js @@ -106,6 +106,7 @@ class PingController { schedule() { setInterval(this.pingAll, config.rates.pingAll); + // todo: make this a cron job? this.pingAll(); }