Update Python tools

This commit is contained in:
ajp_anton
2026-08-09 02:31:54 +00:00
parent b0c707d624
commit 6d28257b54
10 changed files with 362 additions and 12 deletions
+4
View File
@@ -19,6 +19,7 @@ class BackgroundScheduler:
self._stopped = threading.Event()
self._lock = threading.Lock()
self._next_due: dict[str, float] = {}
self._next_cleanup = 0.0
self._running: set[str] = set()
self._thread: threading.Thread | None = None
@@ -40,6 +41,9 @@ class BackgroundScheduler:
def _loop(self) -> None:
while not self._stopped.is_set():
current = time.monotonic()
if current >= self._next_cleanup:
self._next_cleanup = current + 60
self.manager.cleanup_transient_files()
for task in self.tasks:
due = self._next_due.setdefault(task.id, current)
if current >= due: