20% bounces on newsletters is cause for concern.

This commit is contained in:
Samuel Clay 2020-06-03 12:55:44 -04:00
parent 2c747c29f2
commit ed428708e6
2 changed files with 11 additions and 1 deletions

10
fabfile.py vendored
View file

@ -1379,6 +1379,16 @@ def setup_usage_monitor():
sudo('ln -fs %s/utils/monitor_disk_usage.py /etc/cron.daily/monitor_disk_usage' % env.NEWSBLUR_PATH)
sudo('/etc/cron.daily/monitor_disk_usage')
@parallel
def setup_feeds_fetched_monitor():
sudo('ln -fs %s/utils/monitor_task_fetches.py /etc/cron.hourly/monitor_task_fetches' % env.NEWSBLUR_PATH)
sudo('/etc/cron.hourly/monitor_task_fetches')
@parallel
def setup_newsletter_monitor():
sudo('ln -fs %s/utils/monitor_newsletter_delivery.py /etc/cron.hourly/monitor_newsletter_delivery' % env.NEWSBLUR_PATH)
sudo('/etc/cron.hourly/monitor_newsletter_delivery')
@parallel
def setup_redis_monitor():
run('sleep 5') # Wait for redis to startup so the log file is there

View file

@ -24,7 +24,7 @@ def main():
accepted = stats['delivered']['total']
bounced = stats['failed']['permanent']['total'] + stats['failed']['temporary']['total']
if bounced / float(delivered) > 0.1:
if bounced / float(delivered) > 0.2:
requests.post(
"https://api.mailgun.net/v2/%s/messages" % settings.MAILGUN_SERVER_NAME,
auth=("api", settings.MAILGUN_ACCESS_KEY),