Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def retry_once():
if not retry_once._did_retry:
retry_once._did_retry = True
raise RetryTask()
return "Done."
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()