async def retry(maxRetries, tryFn): """
Retry async `tryFn` based on `maxRetries`. Each call to `tryFn` will pass a callable
which should be called with the exception object when an exception can be retried.
Exceptions raised from `tryFn` are treated as fatal. """
retry = -1 # we plus first in the loop, and attempt 1 is retry 0 whileTrue:
retry += 1
# if this isn't the first retry then we sleep if retry > 0:
snooze = float(retry * retry) / 10.0
log.info('Sleeping %0.2f seconds for exponential backoff', snooze)
await asyncio.sleep(utils.calculateSleepTime(retry))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.