diff options
Diffstat (limited to 'webmentions_ssg/tasks/scanner.py')
| -rw-r--r-- | webmentions_ssg/tasks/scanner.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py index 7e163f7..03f4b8d 100644 --- a/webmentions_ssg/tasks/scanner.py +++ b/webmentions_ssg/tasks/scanner.py @@ -385,6 +385,8 @@ def update_source( for webmention in existing.values(): webmention.active = webmention.target in scanned.targets webmention.desired_revision = source.revision + webmention.attempt_count = 0 + webmention.next_retry_at = None if not webmention.active and webmention.sent_revision is None: webmention.processed_revision = source.revision @@ -522,6 +524,8 @@ def scan_sources() -> None: for webmention in source.sent_webmentions: webmention.active = False webmention.desired_revision = source.revision + webmention.attempt_count = 0 + webmention.next_retry_at = None if webmention.sent_revision is None: webmention.processed_revision = source.revision @@ -536,7 +540,11 @@ def scan_sources() -> None: sa.or_( SentWebmention.processed_revision.is_(None), SentWebmention.processed_revision < SentWebmention.desired_revision, - ) + ), + sa.or_( + SentWebmention.next_retry_at.is_(None), + SentWebmention.next_retry_at <= scan_time, + ), ) .order_by(SentWebmention.uuid) ): |
