Stagger outgoing news emails
authorMagnus Hagander <magnus@hagander.net>
Thu, 29 Oct 2020 14:28:06 +0000 (15:28 +0100)
committerMagnus Hagander <magnus@hagander.net>
Thu, 29 Oct 2020 14:28:06 +0000 (15:28 +0100)
Set to a maximum of one outgoing email per 30 minutes

pgweb/news/util.py

index 2c88d78c7b234b7211735ab4e986dc6e6b7599ae..c14e39f7387190f860708b60bced338b95876828 100644 (file)
@@ -1,6 +1,7 @@
 from django.template.loader import get_template
 from django.conf import settings
 
+from datetime import timedelta
 import os
 import hmac
 import hashlib
@@ -98,4 +99,6 @@ def send_news_email(news):
         htmlbody=html,
         attachments=attachments,
         headers=headers,
+        staggertype='news',
+        stagger=timedelta(minutes=30),
     )