diff options
| author | Dennis Fink | 2026-11-19 19:42:41 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-19 20:59:24 +0100 |
| commit | 88f54d9a7699944b7d56f978e724b1c0b54dde98 (patch) | |
| tree | 88ecc527903a91a6f6622ca288b278e5875aff3d /webmentions_ssg/tasks | |
| parent | 8ec35babe87ff8139ec23cc10b858b7481f132db (diff) | |
| download | webmentions-ssg-88f54d9a7699944b7d56f978e724b1c0b54dde98.tar.gz webmentions-ssg-88f54d9a7699944b7d56f978e724b1c0b54dde98.zip | |
feat(sender): add bulk resend and delivery history
Allow admins to resend all failed Webmentions globally or requeue every
delivery for a source using the shared confirmation workflow.
Record outgoing status history, expand sent source details, and provide
human-readable guidance for current and historical delivery failures.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/tasks/sender.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/webmentions_ssg/tasks/sender.py b/webmentions_ssg/tasks/sender.py index fc70f27..3ee5ac1 100644 --- a/webmentions_ssg/tasks/sender.py +++ b/webmentions_ssg/tasks/sender.py @@ -147,7 +147,7 @@ def reserve_send_attempt( if webmention.attempt_count >= max_attempts: # A dead worker may have already consumed the final attempt. Never # finish a newer revision or a retry whose deadline is still in future. - db.session.execute( + updated = db.session.execute( sa.update(SentWebmention) .where( SentWebmention.uuid == webmention.uuid, @@ -170,6 +170,9 @@ def reserve_send_attempt( ) .execution_options(synchronize_session=False) ) + if rows_affected(updated) == 1: + db.session.refresh(webmention) + webmention.record_status_event("Retry limit reached") db.session.commit() return None @@ -326,6 +329,16 @@ def record_delivery_outcome( ) webmention.last_sent_at = datetime.now(UTC) + if result.status == SentWebmentionStatus.SENT: + action = "Delivery succeeded" + elif result.status == SentWebmentionStatus.NO_ENDPOINT: + action = "No endpoint discovered" + elif terminal: + action = "Delivery failed" + else: + action = "Delivery failed; automatic retry scheduled" + webmention.record_status_event(action) + db.session.commit() return True |
