From 8fd569c6c0a39761f7ddda3c6e145d90534b4300 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 30 Oct 2026 20:13:42 +0100 Subject: 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. --- webmentions_ssg/tasks/consumer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'webmentions_ssg/tasks/consumer.py') 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 ) -- cgit v1.3.1