From 6ce1697a3955a3b249a63c26abf4f3aba581f69e Mon Sep 17 00:00:00 2001 From: blockparole <48992448+blockparole@users.noreply.github.com> Date: Mon, 17 Aug 2020 01:18:43 +0200 Subject: [PATCH] configurable ping fail logs (#203) * ping fail log configurable * fix json * fix config namespace in ping * changes --- config.json | 1 + lib/ping.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.json b/config.json index ebe2d93..39e0c16 100644 --- a/config.json +++ b/config.json @@ -9,6 +9,7 @@ "pingAll": 3000, "connectTimeout": 2500 }, + "logFailedPings": true, "logToDatabase": false, "graphDuration": 86400000, "serverGraphDuration": 180000 diff --git a/lib/ping.js b/lib/ping.js index 27e9dab..9425ff4 100644 --- a/lib/ping.js +++ b/lib/ping.js @@ -135,7 +135,7 @@ class PingController { const version = serverRegistration.getNextProtocolVersion() ping(serverRegistration, config.rates.connectTimeout, (err, resp) => { - if (err) { + if (err && config.logFailedPings !== false) { logger.log('error', 'Failed to ping %s: %s', serverRegistration.data.ip, err.message) }