WebHost: fix AutoLauncher restarting rooms due to race condition (#3333)

This commit is contained in:
Fabian Dill
2024-05-19 15:17:55 +02:00
committed by GitHub
parent 230a9e620b
commit 663b50b33e
2 changed files with 12 additions and 14 deletions

View File

@@ -80,7 +80,7 @@ def autohost(config: dict):
room.last_activity >= datetime.utcnow() - timedelta(days=3))
for room in rooms:
# we have to filter twice, as the per-room timeout can't currently be PonyORM transpiled.
if room.last_activity >= datetime.utcnow() - timedelta(seconds=room.timeout):
if room.last_activity >= datetime.utcnow() - timedelta(seconds=room.timeout + 5):
hosters[room.id.int % len(hosters)].start_room(room.id)
except AlreadyRunningException: