aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/scanner.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-12 23:34:46 +0100
committerDennis Fink2026-11-12 23:37:08 +0100
commit52fc66cb5ff19bf0def001ae50acc1b465a0b977 (patch)
treee791fa3e6d9f9b1b6fdf697f821adc84d2a57f0b /webmentions_ssg/tasks/scanner.py
parentb439de2005b70ec3867d589d1f4c63b83441e620 (diff)
downloadwebmentions-ssg-52fc66cb5ff19bf0def001ae50acc1b465a0b977.tar.gz
webmentions-ssg-52fc66cb5ff19bf0def001ae50acc1b465a0b977.zip
fix(core): decouple task imports from app initialization
Keep stable lazy task handles that register against the active Huey backend so modules can be imported before app creation and survive backend reinitialization. Separate package metadata and the shared blueprint from application startup to remove import-order dependencies and keep build-time version lookup lightweight.
Diffstat (limited to 'webmentions_ssg/tasks/scanner.py')
-rw-r--r--webmentions_ssg/tasks/scanner.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py
index 353d538..263b8a5 100644
--- a/webmentions_ssg/tasks/scanner.py
+++ b/webmentions_ssg/tasks/scanner.py
@@ -110,9 +110,7 @@ def scan_sources() -> None:
:raises RuntimeError: If the configured source directory or base URL is
invalid.
"""
- # Resolve the lock at execution time. The global Huey extension can be
- # reinitialized by Flask app factories (notably in the test suite), so an
- # import-time lock decorator may point at an obsolete storage backend.
+ # Manual and periodic scans must contend for the current backend's lock.
with huey.lock_task("scan-webmention-sources"):
scan_sources_task()