From 44e8926ec4a4755cd7588831648aed842a07002e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 21 Jan 2025 13:14:32 +0100 Subject: Enable/disable timeouts from .env configuration. --- server.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index e01b477..37a292e 100644 --- a/server.js +++ b/server.js @@ -12,7 +12,8 @@ const sqlite3 = require("better-sqlite3") require("dotenv").config() -const DEBUG = process.env.DEBUG || 0 +const DEBUG = process.env.DEBUG | 0 +const TIMEOUT = process.env.TIMEOUT | 0 const ALTCHA = process.env.ALTCHA | 0 const HTTP_HOST = process.env.HTTP_HOST || "localhost" @@ -2722,8 +2723,10 @@ function time_control_ticker() { } // Run time control checks every 13 minutes. -setInterval(time_control_ticker, 13 * 60 * 1000) -setTimeout(time_control_ticker, 13 * 1000) +if (TIMEOUT) { + setInterval(time_control_ticker, 13 * 60 * 1000) + setTimeout(time_control_ticker, 13 * 1000) +} /* * TOURNAMENTS -- cgit v1.2.3