Skip to main content

Fork of a popular backoff library with a few fixed bugs

Project description

improved_backoff

image image image image

image image image image

Function decoration for backoff and retry

This is a fork of an excellent Python library backoff. The library was forked on January 26, 2023. It includes the original version 2.2.1 (October 5, 2022) and a few extra updates.

This fork includes 2 PRs proposed in the original repo:

The updated behavior of max_time is that a a function will be retried only if the elapsed time is less, than max_time. Also the remaining time should exceed the interval (delay between retries).

The code that calculates delay time was modified to not generate negative values. If at the time of calculation elapsed time exceeds specified max_time value than delay is set to zero. If calculated delay time is negative, then it's also set to zero.

In order to use this module import it under backoff alias and use it the same way as the original module

import improved_backoff as backoff

@backoff.on_exception(backoff.expo, requests.exceptions.RequestException)
def get_url(url):
    return requests.get(url)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

improved_backoff-1.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

improved_backoff-1.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file improved_backoff-1.2.tar.gz.

File metadata

  • Download URL: improved_backoff-1.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.13 Windows/10

File hashes

Hashes for improved_backoff-1.2.tar.gz
Algorithm Hash digest
SHA256 c3a03bcc24853b31f5d512d5b5996d1f6ef130e0fcbfaa57b43cdaf97866e955
MD5 a5cd55708c09d083cdd5a690e6b9fd34
BLAKE2b-256 1ddf1bb55a599da1ece42024d545c8a5f425e9fc235574b0d03e050c63995634

See more details on using hashes here.

File details

Details for the file improved_backoff-1.2-py3-none-any.whl.

File metadata

  • Download URL: improved_backoff-1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.13 Windows/10

File hashes

Hashes for improved_backoff-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 62f7203b5f4214236bdc14aa9eb53c5fee9a97519655c8021726989d9575574f
MD5 26fa4a39f41058dcac35e3af1fab5930
BLAKE2b-256 130caaf14a9293b900446213134c8c08c7cdf857bf2324500c658feface17aa3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page