You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromessentials.decoratorsimportretry@retry()deffunction_that_supports_automatic_retries():
# do something...pass@retry()asyncdefasync_function_that_supports_automatic_retries():
# do await something...pass
Options: in the example below, a function is retried up to 5 times, with a delay of 0.5 s between retries, and catching only a specific type of exception, for example MyKindOfException.
fromessentials.decoratorsimportretry# example: try again up to 5 times, with a delay of 0.5 s between retries,@retry(times=5, delay=0.5, catch_exceptions_types=MyKindOfException)deffunction_that_supports_automatic_retries():
# do something...pass