aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/notifications.py
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/tasks/notifications.py')
-rw-r--r--webmentions_ssg/tasks/notifications.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/webmentions_ssg/tasks/notifications.py b/webmentions_ssg/tasks/notifications.py
index fc1b475..b1762d5 100644
--- a/webmentions_ssg/tasks/notifications.py
+++ b/webmentions_ssg/tasks/notifications.py
@@ -15,14 +15,22 @@ from ..models import ReceivedStatus, ReceivedWebmention
def send_webmention_digest() -> None:
- """Send one digest of verified, previously unreported Webmentions."""
+ """Send one digest of verified, previously unreported Webmentions.
+
+ Acquire the digest lock before notifying recipients about previously unreported
+ verified mentions.
+ """
# Resolve the lock against the current Huey backend, not the import-time one.
with huey.lock_task("send-webmention-digest"):
_send_webmention_digest()
def _send_webmention_digest() -> None:
- """Do the work while the current backend's digest lock is held."""
+ """Do the work while the current backend's digest lock is held.
+
+ Collect verified mentions, send the configured message, and persist notification
+ timestamps.
+ """
recipient = current_app.config.get("NOTIFICATION_EMAIL")
if not recipient:
return