diff options
| author | Dennis Fink | 2026-10-30 20:13:42 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-30 20:13:42 +0100 |
| commit | 8fd569c6c0a39761f7ddda3c6e145d90534b4300 (patch) | |
| tree | f92209df1918fd5c9ac27efe25463afaef2a1a5f /webmentions_ssg/tasks/consumer.py | |
| parent | a2992533873cb53acb052cdcd4288430b24af587 (diff) | |
| download | webmentions-ssg-8fd569c6c0a39761f7ddda3c6e145d90534b4300.tar.gz webmentions-ssg-8fd569c6c0a39761f7ddda3c6e145d90534b4300.zip | |
fix(receiver): recover stale Webmention verifications
Add a periodic recovery sweep for Webmentions left in received or
verifying states after worker crashes, lost queue entries, or
interrupted processing.
Use atomic lease-style updates so stale workers cannot overwrite newer
results, and index verification state for efficient recovery scans.
Diffstat (limited to 'webmentions_ssg/tasks/consumer.py')
| -rw-r--r-- | webmentions_ssg/tasks/consumer.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/webmentions_ssg/tasks/consumer.py b/webmentions_ssg/tasks/consumer.py index 559ef5d..afae6e0 100644 --- a/webmentions_ssg/tasks/consumer.py +++ b/webmentions_ssg/tasks/consumer.py @@ -14,8 +14,8 @@ def create_consumer() -> Huey: Create and configure the Huey consumer. The application is initialized, task modules are imported to register their - tasks, and the source scanner is registered with the configured periodic - schedule. + tasks, and periodic scanner, notification and verification recovery tasks + are registered. :return: Configured Huey instance. """ @@ -26,6 +26,11 @@ def create_consumer() -> Huey: schedule = crontab(*app.config["SCANNER_SCHEDULE"].split(), strict=True) HUEY.periodic_task(schedule)(scanner.scan_sources) + recovery_schedule = crontab( + *app.config["VERIFICATION_REAPER_SCHEDULE"].split(), strict=True + ) + HUEY.periodic_task(recovery_schedule)(receiver.recover_stale_webmentions) + notification_schedule = crontab( *app.config["NOTIFICATION_SCHEDULE"].split(), strict=True ) |
