customserver: preemtively run GC before starting room (#3637)

GC seems to be lazy.
This commit is contained in:
black-sliver 2024-07-14 13:56:27 +02:00 committed by GitHub
parent eaec41d885
commit 187f9dac94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -325,6 +325,7 @@ def run_server_process(name: str, ponyconfig: dict, static_server_data: dict,
def run(self):
while 1:
next_room = rooms_to_run.get(block=True, timeout=None)
gc.collect(0)
task = asyncio.run_coroutine_threadsafe(start_room(next_room), loop)
self._tasks.append(task)
task.add_done_callback(self._done)