time measurement
This commit is contained in:
+8
-1
@@ -35,6 +35,8 @@ Environment variables
|
||||
UPDATER_LOG default /config/volume_updater.log
|
||||
COVER_CACHE_PATH directory for the persistent cover cache;
|
||||
empty (default) = temporary cache, deleted on exit
|
||||
PERF_PATH JSON file for per-step move timing stats;
|
||||
empty disables profiling. Default /config/perf_stats.json
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -61,6 +63,7 @@ from SuwayomiFolderWatcher import SuwayomiFolderWatcher # noqa: E402,F401
|
||||
from MatchesCache import MatchesCache # noqa: E402
|
||||
from MatchesWebApp import MatchesWebApp # noqa: E402
|
||||
from KavitaVolumeCoverUpdater import KavitaVolumeCoverUpdater # noqa: E402
|
||||
from PerfStats import PerfStats # noqa: E402
|
||||
|
||||
|
||||
def _env_str(name: str, default: "str | None" = None,
|
||||
@@ -107,6 +110,7 @@ def main() -> int:
|
||||
updater_schedule = _env_str("UPDATER_SCHEDULE", "0 19 * * 1,4")
|
||||
updater_log = _env_str("UPDATER_LOG", "/config/volume_updater.log")
|
||||
cover_cache_path = _env_str("COVER_CACHE_PATH", "") or None
|
||||
perf_path = _env_str("PERF_PATH", "/config/perf_stats.json") or None
|
||||
|
||||
print(f"[main] suwayomi = {suwayomi_path}", flush=True)
|
||||
print(f"[main] kavita = {kavita_path}", flush=True)
|
||||
@@ -118,6 +122,7 @@ def main() -> int:
|
||||
print(f"[main] web = {web_host}:{web_port}", flush=True)
|
||||
|
||||
matches_cache = MatchesCache(match_path)
|
||||
perf_stats = PerfStats(perf_path)
|
||||
|
||||
mover = SuwayomiMover(
|
||||
suwayomi_path, kavita_path,
|
||||
@@ -128,11 +133,13 @@ def main() -> int:
|
||||
delete_source=delete_source,
|
||||
matches_cache=matches_cache,
|
||||
cover_cache_dir=cover_cache_path,
|
||||
perf_stats=perf_stats,
|
||||
)
|
||||
|
||||
# watcher = SuwayomiFolderWatcher(suwayomi_path, mover, settle_seconds=settle_seconds)
|
||||
|
||||
web_app = MatchesWebApp(matches_cache, mover=mover, host=web_host, port=web_port)
|
||||
web_app = MatchesWebApp(matches_cache, mover=mover, perf_stats=perf_stats,
|
||||
host=web_host, port=web_port)
|
||||
web_app.start()
|
||||
|
||||
if updater_enabled:
|
||||
|
||||
Reference in New Issue
Block a user