Skip to content

Commit

Permalink
CustomServer: run GC after setup
Browse files Browse the repository at this point in the history
  • Loading branch information
black-sliver committed Sep 10, 2023
1 parent c24bbf6 commit f33b583
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions WebHostLib/customserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,14 @@ def run_server_process(room_id, ponyconfig: dict, static_server_data: dict,
db.generate_mapping(check_tables=False)

async def main():
import gc

Utils.init_logging(str(room_id), write_mode="a")
ctx = WebHostContext(static_server_data)
ctx.load(room_id)
ctx.init_save()
ssl_context = load_server_cert(cert_file, cert_key_file) if cert_file else None
gc.collect() # free intermediate objects used during setup
try:
ctx.server = websockets.serve(functools.partial(server, ctx=ctx), ctx.host, ctx.port, ssl=ssl_context)

Expand Down

0 comments on commit f33b583

Please sign in to comment.