summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-01-21 13:14:32 +0100
committerTor Andersson <tor@ccxvii.net>2025-01-29 00:26:56 +0100
commit44e8926ec4a4755cd7588831648aed842a07002e (patch)
tree166b8c6e2aa3d8c211ae7bea2eb013107801f644
parent5e43c931dc46c3b6772326169dbd0c3fd425644f (diff)
downloadserver-44e8926ec4a4755cd7588831648aed842a07002e.tar.gz
Enable/disable timeouts from .env configuration.
-rw-r--r--server.js9
1 files 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