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 f7e968666e - Show all commits

View File

@ -2,7 +2,6 @@ import asyncio
import datetime
import mimetypes
import threading
import tracemalloc
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path, PurePath, PurePosixPath
from stat import S_IFDIR, S_IFREG
@ -10,7 +9,6 @@ from urllib.parse import unquote
from wsgiref.handlers import format_date_time
import brotli
import objgraph
import sanic.helpers
from blake3 import blake3
from sanic import Blueprint, Sanic, empty, raw, redirect
@ -34,7 +32,6 @@ app.exception(Exception)(handle_sanic_exception)
@app.before_server_start
async def main_start(app, loop):
tracemalloc.start()
config.load_config()
app.ctx.threadexec = ThreadPoolExecutor(
max_workers=3, thread_name_prefix="cista-ioworker"
@ -42,17 +39,6 @@ async def main_start(app, loop):
await watching.start(app, loop)
@app.add_task
async def mem_task():
while True:
await asyncio.sleep(10)
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics("lineno")
for stat in top_stats[:10]:
print(stat)
objgraph.show_growth(limit=10)
@app.after_server_stop
async def main_stop(app, loop):
quit.set()