Bogdanp / dramatiq

A fast and reliable background task processing library for Python 3.
https://dramatiq.io
GNU Lesser General Public License v3.0
4.28k stars 306 forks source link

Add callback for retry exhaustion #630

Closed dbowring closed 3 weeks ago

dbowring commented 3 months ago

E.g.,

@dramatiq.actor
def on_abandon_flaky_work(message_data, retry_info):
    logger.info("Too flaky, will not retry", message_data=message_data, retry_info=retry_info)

@dramatiq.actor(max_retries=5, on_retry_exhausted=on_abandon_flaky_work.actor_name)
def my_flaky_actor(*args, **kwargs):
    do_flaky_work(*args, **kwargs)
dbowring commented 3 weeks ago

@Bogdanp Is there any chance of this (or something like this) being merged?

Bogdanp commented 3 weeks ago

Sorry for the delay, this slipped under my radar. Thanks!