From c96ca9c893c2c8a1556d8f1dd2b832df68795ced Mon Sep 17 00:00:00 2001 From: Andrew Redden Date: Tue, 19 Nov 2019 21:08:12 -0400 Subject: [PATCH] added general exception handling to the bounty_email delay call logging an error of the caught exception - removed print statement --- app/marketing/mails.py | 7 ++++++- app/taskapp/celery.py | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/marketing/mails.py b/app/marketing/mails.py index 9a60accb672..073ed7b5a35 100644 --- a/app/marketing/mails.py +++ b/app/marketing/mails.py @@ -663,7 +663,12 @@ def no_applicant_reminder(to_email, bounty): def share_bounty(emails, msg, profile, invite_url=None, kudos_invite=False): from dashboard.tasks import bounty_emails - bounty_emails.delay(emails, msg, profile.handle, invite_url, kudos_invite) + # attempt to delay bounty_emails task to a worker + # long on failure to queue + try: + bounty_emails.delay(emails, msg, profile.handle, invite_url, kudos_invite) + except Exception as e: + logger.error(str(e)) def new_reserved_issue(from_email, user, bounty): diff --git a/app/taskapp/celery.py b/app/taskapp/celery.py index f0ddd3ecaed..a488c128586 100644 --- a/app/taskapp/celery.py +++ b/app/taskapp/celery.py @@ -20,8 +20,6 @@ def on_celery_setup_logging(**kwargs): def ready(self): # Using a string here means the worker will not have to - # pickle the object when using Windows. app.config_from_object('django.conf:settings', namespace='CELERY') installed_apps = [app_config.name for app_config in apps.get_app_configs()] - print(installed_apps) app.autodiscover_tasks(lambda: installed_apps, force=True)