How to use the huey.exceptions.RetryTask function in huey

To help you get started, we’ve selected a few huey examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scoutapp / scout_apm_python / tests / integration / test_huey.py View on Github external
def retry_once():
        if not retry_once._did_retry:
            retry_once._did_retry = True
            raise RetryTask()
        return "Done."
github scoutapp / scout_apm_python / src / scout_apm / huey.py View on Github external
def scout_on_post_execute(task, task_value, exception):
    tracked_request = TrackedRequest.instance()
    if exception is None:
        tracked_request.is_real_request = True
    elif isinstance(exception, TaskLockedException):
        pass
    elif isinstance(exception, RetryTask):
        tracked_request.is_real_request = True
        tracked_request.tag("retrying", True)
    else:
        tracked_request.is_real_request = True
        tracked_request.tag("error", "true")
    tracked_request.stop_span()