Skip to content

Instantly share code, notes, and snippets.

@stevenewey
Created July 10, 2012 15:56
Show Gist options
  • Save stevenewey/3084293 to your computer and use it in GitHub Desktop.
Save stevenewey/3084293 to your computer and use it in GitHub Desktop.
@celery.task(ignore_result=True, max_retries=3)
def season(data):
competition = mongo.Competition.one({
'opta_competition_id': data['competition_id'],
}, ['_id'])
if not competition:
raise season.retry()
"""[2012-07-10 16:22:31,079: ERROR/MainProcess] Task kemari.opta.tasks.season[f1501987-8185-4055-8f0d-52de2859e303] raised exception: UnboundLocalError("local variable 'season' referenced before assignment",)"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment