logs_commit1

This commit is contained in:
Mateusz Gruszczyński
2026-05-20 08:21:58 +02:00
parent 7401feff63
commit 94f81911a1
13 changed files with 380 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ from __future__ import annotations
from threading import RLock
from time import time
from . import rtorrent
from . import rtorrent, operation_logs
_VOLATILE = {"down_rate", "down_rate_h", "up_rate", "up_rate_h", "progress", "completed_bytes", "peers", "seeds", "ratio", "state", "status", "message", "down_total", "down_total_h", "to_download", "to_download_h", "up_total", "up_total_h"}
@@ -58,6 +58,8 @@ class TorrentCache:
self._data[profile_id] = fresh
self._errors[profile_id] = ""
self._updated_at[profile_id] = time()
if old:
operation_logs.record_cache_diff(profile_id, added, removed, updated, old)
return {"ok": True, "profile_id": profile_id, "added": added, "updated": updated, "removed": removed, "post_check_changes": post_check_changes}
except Exception as exc:
with self._lock: