fix multiprocessing

+ remove global locks
This commit is contained in:
cwilvx
2025-03-10 21:05:28 +03:00
parent 9725fd427b
commit 0eef23880b
12 changed files with 140 additions and 689 deletions
+12 -10
View File
@@ -6,9 +6,10 @@ import logging
import os
import psutil
import waitress
import bjoern
# import bjoern
import mimetypes
import setproctitle
import multiprocessing
from flask_jwt_extended import (
create_access_token,
@@ -229,6 +230,7 @@ def print_memory_usage(response: Response):
return response
if __name__ == "__main__":
multiprocessing.freeze_support()
load_into_mem()
run_swingmusic()
# TrackStore.export()
@@ -237,13 +239,13 @@ if __name__ == "__main__":
host = FLASKVARS.get_flask_host()
port = FLASKVARS.get_flask_port()
# waitress.serve(
# app,
# host=host,
# port=port,
# threads=100,
# ipv6=True,
# ipv4=True,
# )
waitress.serve(
app,
host=host,
port=port,
threads=100,
ipv6=True,
ipv4=True,
)
# app.run(host=host, port=port, debug=False)
bjoern.run(app, host, port)
# bjoern.run(app, host, port)