From 63cc5ed2213b00f2a14e8e74e9ee27b6f9b3c982 Mon Sep 17 00:00:00 2001 From: Daniel Engelhardt Date: Wed, 14 Aug 2024 09:43:53 +0200 Subject: [PATCH] Adjust mail sendout --- DSTBundesliga/apps/dstffbl/services/season_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DSTBundesliga/apps/dstffbl/services/season_service.py b/DSTBundesliga/apps/dstffbl/services/season_service.py index 3d8e7b4..d56eebe 100644 --- a/DSTBundesliga/apps/dstffbl/services/season_service.py +++ b/DSTBundesliga/apps/dstffbl/services/season_service.py @@ -137,7 +137,8 @@ def create_season_users(users): print("...done!") -def send_email_chunk(chunk_size=12): +# Rate limit is 500/h +def send_email_chunk(chunk_size=500): open_mails = DSTEmail.objects.filter(send_ts=None)[:chunk_size] for mail in open_mails: success = mail.send_mail()