From 85b10c38f39732421a230d938adddc7805d0e001 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Mon, 16 Nov 2026 09:27:29 +0100 Subject: style(core): reorder module declarations Group globals and data classes near module imports, keep primary classes and functions together, and move implementation helpers after their public callers. Reorder Alembic setup so configuration happens after the required helpers are defined, without changing runtime behavior. --- webmentions_ssg/tasks/verification.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'webmentions_ssg/tasks/verification.py') 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. -- cgit v1.3.1