Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Recommended retry package?

20 views
Skip to first unread message

Miki Tebeka

unread,
Jul 31, 2024, 5:09:44 AM7/31/24
to PyWeb-IL
Hi,

Any recommendation on a "retry" package?
I know of https://pypi.org/project/backoff/ but it unmaintained.

Thanks,
Miki

Lior Kaplan

unread,
Aug 2, 2024, 2:26:14 PM8/2/24
to pywe...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "PyWeb-IL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyweb-il+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyweb-il/839ce99b-93a1-4938-8abc-7a6d2d9ef06bn%40googlegroups.com.

Yuval Adam

unread,
Aug 2, 2024, 2:26:27 PM8/2/24
to pywe...@googlegroups.com
Tenacity is pretty good and well maintained - https://github.com/jd/tenacity

--
You received this message because you are subscribed to the Google Groups "PyWeb-IL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyweb-il+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyweb-il/839ce99b-93a1-4938-8abc-7a6d2d9ef06bn%40googlegroups.com.


--
Yuval Adam

Tal Einat

unread,
Aug 2, 2024, 2:26:43 PM8/2/24
to pywe...@googlegroups.com
Hi Miki,

I like the funcy library very much. Its retry decorator is good, we've been happy with it at my workplace.

Example bit of code to try to read and then update a Kubernetes resource and gracefully handle conflicts:

@funcy.retry(
    tries=5,
    errors=kubernetes.client.exceptions.ApiException,
    filter_errors=lambda exc: exc.reason == "Conflict",
    timeout=lambda n_attempt: random.uniform(0.05, 0.15) + 0.05 * n_attempt,
)
def read_and_patch_k8s_resource(): ...

- Tal Tiano Einat

--

Miki Tebeka

unread,
Aug 4, 2024, 9:15:01 AM8/4/24
to pywe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages