UI - "Recheck all" should also queue most overdue first (same like automatic scheduler) (#3087)

pull/3089/head
dgtlmoon 2025-04-04 12:40:21 +02:00 zatwierdzone przez GitHub
rodzic 78b7aee512
commit 786e0d1fab
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -125,7 +125,10 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, running_updat
else:
# Recheck all, including muted
for watch_uuid, watch in datastore.data['watching'].items():
# Get most overdue first
for k in sorted(datastore.data['watching'].items(), key=lambda item: item[1].get('last_checked', 0)):
watch_uuid = k[0]
watch = k[1]
if not watch['paused']:
if watch_uuid not in running_uuids:
if with_errors and not watch.get('last_error'):
@ -140,7 +143,7 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, running_updat
if i == 1:
flash("Queued 1 watch for rechecking.")
if i > 1:
flash("Queued {} watches for rechecking.".format(i))
flash(f"Queued {i} watches for rechecking.")
if i == 0:
flash("No watches available to recheck.")