diff options
Diffstat (limited to 'webmentions_ssg/tasks/verification.py')
| -rw-r--r-- | webmentions_ssg/tasks/verification.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/webmentions_ssg/tasks/verification.py b/webmentions_ssg/tasks/verification.py index a614815..b0f4d0f 100644 --- a/webmentions_ssg/tasks/verification.py +++ b/webmentions_ssg/tasks/verification.py @@ -29,6 +29,9 @@ from ..version import APP_NAME, VERSION from .target_matching import html_mentions_target, text_mentions_target +RECOVERY_EXHAUSTED_REASON = "Verification recovery limit reached" + + class VerificationError(Exception): """The source permanently failed ReceivedWebmention verification.""" @@ -41,7 +44,14 @@ class RetryableFetchError(Exception): """Fetching the source may succeed when retried later.""" -RECOVERY_EXHAUSTED_REASON = "Verification recovery limit reached" +@dataclass(frozen=True) +class VerificationClaim: + """Source and lease version for one atomically claimed verification.""" + + webmention_uuid: uuid.UUID + source: str + target: str + lease_started_at: datetime def fetch_source_document(source_url: str) -> tuple[httpx.Response, bytes]: @@ -125,16 +135,6 @@ def source_mentions_target(source_url: str, target_url: str) -> bool: ) -@dataclass(frozen=True) -class VerificationClaim: - """Source and lease version for one atomically claimed verification.""" - - webmention_uuid: uuid.UUID - source: str - target: str - lease_started_at: datetime - - def claim_for_verification(webmention_uuid: uuid.UUID) -> VerificationClaim | None: """Claim an eligible row, returning its source, target, and lease version. |
