aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/scanner.py
diff options
context:
space:
mode:
authorDennis Fink2026-08-17 20:06:22 +0200
committerDennis Fink2026-08-17 20:06:22 +0200
commitd4a03623544aac0ce911d8471ff4b033bc3255e1 (patch)
tree0d707db5a9aed7442c28e0ac0de8898aab54c090 /webmentions_ssg/tasks/scanner.py
parent85a73c811a3de333138978d8d450533caa668dc5 (diff)
downloadwebmentions-ssg-d4a03623544aac0ce911d8471ff4b033bc3255e1.tar.gz
webmentions-ssg-d4a03623544aac0ce911d8471ff4b033bc3255e1.zip
feat(sender): add manual source rescan action
Add an authenticated action to queue a source rescan from the sent Webmentions overview. Extract the reusable confirmation modal and its JavaScript so received and sent admin actions share the same implementation.
Diffstat (limited to 'webmentions_ssg/tasks/scanner.py')
-rw-r--r--webmentions_ssg/tasks/scanner.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py
index f80e5f4..ff75697 100644
--- a/webmentions_ssg/tasks/scanner.py
+++ b/webmentions_ssg/tasks/scanner.py
@@ -1,6 +1,6 @@
from collections.abc import Iterator
from dataclasses import dataclass
-from datetime import datetime, timezone
+from datetime import UTC, datetime
from fnmatch import fnmatchcase
from itertools import chain
from pathlib import Path
@@ -327,7 +327,7 @@ def scan_sources() -> None:
seen_paths: set[str] = set()
scanned_count = 0
- scan_time = datetime.now(timezone.utc)
+ scan_time = datetime.now(UTC)
for index_path in root.rglob("index.html"):
relative_path = index_path.relative_to(root)
@@ -395,3 +395,8 @@ def scan_sources() -> None:
scanned_count,
pending_count,
)
+
+
+@huey.task()
+def manual_scan_sources() -> None:
+ return scan_sources()