From 875c2003a4c92728c9bf59ec0acea1712847e952 Mon Sep 17 00:00:00 2001 From: Berserker Date: Wed, 11 Mar 2026 10:06:51 +0100 Subject: [PATCH] WebHost: make autolauncher max room timeout configurable --- WebHostLib/__init__.py | 2 ++ WebHostLib/autolauncher.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index d10c17bff8..f1ac7ad558 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -46,6 +46,8 @@ app.config["SELFGEN"] = True # application process is in charge of scheduling G app.config["JOB_THRESHOLD"] = 1 # after what time in seconds should generation be aborted, freeing the queue slot. Can be set to None to disable. app.config["JOB_TIME"] = 600 +# maximum time in seconds since last activity for a room to be hosted +app.config["MAX_ROOM_TIMEOUT"] = 259200 # memory limit for generator processes in bytes app.config["GENERATOR_MEMORY_LIMIT"] = 4294967296 diff --git a/WebHostLib/autolauncher.py b/WebHostLib/autolauncher.py index b48c6a8cbb..2d519a8776 100644 --- a/WebHostLib/autolauncher.py +++ b/WebHostLib/autolauncher.py @@ -129,7 +129,7 @@ def autohost(config: dict): with db_session: rooms = select( room for room in Room if - room.last_activity >= utcnow() - timedelta(days=3)) + room.last_activity >= utcnow() - timedelta(seconds=config["MAX_ROOM_TIMEOUT"])) for room in rooms: # we have to filter twice, as the per-room timeout can't currently be PonyORM transpiled. if room.last_activity >= utcnow() - timedelta(seconds=room.timeout + 5):