python - Stop retrying periodic celery task on error -
imagine task in celery schedule
, runs each minute , sends email on errors. if there error, it's more persistent, database unavailability, mail box get's spammed similar emails.
what's possible workarounds?
you use flag program knows whether has sent alarm email, gets set false once database comes online
the code example of concept.. it's unrelated celery, i'm sure can work fit needs
database_flag = false database = get_database() while true: if not database.is_faulted(): database_flag = false elif database.is_faulted() , not database_flag: send_email() database_flag = true time.sleep(60)
Comments
Post a Comment