From 82495162be98323fc56a35f2c2a59c143a765136 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 13 Nov 2026 20:40:37 +0100 Subject: 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. --- webmentions_ssg/tasks/scanner.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'webmentions_ssg/tasks/scanner.py') 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, -- cgit v1.3.1