Skip to content

Commit

Permalink
added general exception handling to the bounty_email delay call
Browse files Browse the repository at this point in the history
logging an error of the caught exception
- removed print statement
  • Loading branch information
androolloyd committed Nov 20, 2019
1 parent 5f4205b commit c96ca9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/marketing/mails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions app/taskapp/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit c96ca9c

Please sign in to comment.