aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/scanner.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-13 20:40:37 +0100
committerDennis Fink2026-11-13 20:40:37 +0100
commit82495162be98323fc56a35f2c2a59c143a765136 (patch)
treeebee8daa3eabe4abd8ae6a43b22655e6e6c970f2 /webmentions_ssg/tasks/scanner.py
parent22f453be12822f1c26f2ba6e229cdc8840ffaa92 (diff)
downloadwebmentions-ssg-82495162be98323fc56a35f2c2a59c143a765136.tar.gz
webmentions-ssg-82495162be98323fc56a35f2c2a59c143a765136.zip
refactor(core): centralize pending revision logic
Make `SentWebmention.pending` a hybrid property so the same definition works in Python and SQL expressions. Reuse it across sender and scanner guards to remove duplicated revision checks.
Diffstat (limited to 'webmentions_ssg/tasks/scanner.py')
-rw-r--r--webmentions_ssg/tasks/scanner.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py
index 263b8a5..f3665ee 100644
--- a/webmentions_ssg/tasks/scanner.py
+++ b/webmentions_ssg/tasks/scanner.py
@@ -226,10 +226,7 @@ def scan_sources_task() -> None:
for identifier in db.session.scalars(
sa.select(SentWebmention.uuid)
.where(
- sa.or_(
- SentWebmention.processed_revision.is_(None),
- SentWebmention.processed_revision < SentWebmention.desired_revision,
- ),
+ SentWebmention.pending,
sa.or_(
SentWebmention.next_retry_at.is_(None),
SentWebmention.next_retry_at <= scan_time,