From f6d96df2c3aecb51ca97426efddb101dce6350d7 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 30 Oct 2026 13:24:53 +0100 Subject: feat(sender): add persistent retry backoff Persist retry state per source revision so temporary delivery failures survive worker restarts and duplicate queued tasks cannot bypass the retry schedule. Use capped exponential backoff, stop after a configurable attempt limit, and reset the retry budget when a source changes or an admin resends manually. --- webmentions_ssg/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'webmentions_ssg/models.py') diff --git a/webmentions_ssg/models.py b/webmentions_ssg/models.py index 11740a8..4f688e5 100644 --- a/webmentions_ssg/models.py +++ b/webmentions_ssg/models.py @@ -245,6 +245,14 @@ class SentWebmention(Base): ) status_url: Mapped[str | None] = mapped_column(Text(), nullable=True, default=None) + # Retry state belongs to the desired revision, not to the target forever. + attempt_count: Mapped[int] = mapped_column( + Integer(), nullable=False, default=0 + ) + next_retry_at: Mapped[datetime | None] = mapped_column( + DateTime(timezone=True), nullable=True, default=None + ) + last_attempted_at: Mapped[datetime | None] = mapped_column( DateTime(timezone=True), nullable=True, default=None ) -- cgit v1.3.1