Various build fixes, cleanup and details #6

Merged
leo merged 34 commits from trace into main 2023-11-21 15:32:49 +00:00
Showing only changes of commit 058bc9f912 - Show all commits

View File

@ -3,6 +3,7 @@ import datetime
import mimetypes
import threading
from concurrent.futures import ThreadPoolExecutor
from multiprocessing import cpu_count
from pathlib import Path, PurePath, PurePosixPath
from stat import S_IFDIR, S_IFREG
from urllib.parse import unquote
@ -33,8 +34,9 @@ app.exception(Exception)(handle_sanic_exception)
@app.before_server_start
async def main_start(app, loop):
config.load_config()
N = max(2, min(8, cpu_count()))
app.ctx.threadexec = ThreadPoolExecutor(
max_workers=3, thread_name_prefix="cista-ioworker"
max_workers=N, thread_name_prefix="cista-ioworker"
)
await watching.start(app, loop)