diff options
| author | Dennis Fink | 2026-10-29 20:59:48 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-29 20:59:48 +0100 |
| commit | edd7c0c2220ba12c2a773f9ba1cf6e0e7a273856 (patch) | |
| tree | c067d16841e3d3441e3b4c6f7ed833a6d57fae04 /webmentions_ssg/migrations/versions | |
| parent | 9a1e863079b64883beadaba7b283621f1b3cf70a (diff) | |
| download | webmentions-ssg-edd7c0c2220ba12c2a773f9ba1cf6e0e7a273856.tar.gz webmentions-ssg-edd7c0c2220ba12c2a773f9ba1cf6e0e7a273856.zip | |
feat(receiver): send Webmention notification digests
Batch verified Webmention notifications into a scheduled digest so
bursts of incoming mentions do not generate a separate email for every
verification.
Track which mentions have already been reported and leave them pending
when SMTP delivery fails so a later digest can retry safely.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py b/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py new file mode 100644 index 0000000..905b2c2 --- /dev/null +++ b/webmentions_ssg/migrations/versions/408fc2eca9ce_track_webmention_digest_notifications.py @@ -0,0 +1,36 @@ +"""Track webmention digest notifications + +Revision ID: 408fc2eca9ce +Revises: be6e229d6a3d +Create Date: 2026-10-29 20:24:42.008723 + +""" + +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "408fc2eca9ce" +down_revision = "be6e229d6a3d" +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table("received_webmentions", schema=None) as batch_op: + batch_op.add_column( + sa.Column("notification_sent_at", sa.DateTime(timezone=True), nullable=True) + ) + op.execute( + "UPDATE received_webmentions SET notification_sent_at = CURRENT_TIMESTAMP" + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table("received_webmentions", schema=None) as batch_op: + batch_op.drop_column("notification_sent_at") + + # ### end Alembic commands ### |
