Questions tagged [retrying]

12 questions
4
votes
2 answers

Python retry with dynamic parameters

Tried this in the retrying and tenacity python libraries to no avail. Retries are typically used with a decorator, for example as shown in metacode below: class FooBar: @retry(attempts=3) def dosomething(): ... I want the retry…
Adam Hughes
  • 14,601
  • 12
  • 83
  • 122
2
votes
2 answers

Passing multiple arguments to retry_on_exception argument of retrying in python

I have a usecase where a method which adds a row to a table needs to be retried in case of any exception. I am using @retry decorator of retrying to achieve this. One of the cases is when there is a change of password of the db. I am using the arg…
darthsithius
  • 73
  • 2
  • 10
2
votes
0 answers

How to detect if retry fails with the Python retrying module?

I use the Python retrying library to wait and retry download when server is in DDoS protection, but my question is how can I throw an exception when all retries fail ? In my code the download(symbol) function might raise a DDoSProtection exception.…
Florent
  • 1,791
  • 22
  • 40
2
votes
1 answer

Retry does not work when running with run_until_complete

First, I running the code like that, and the retry is working properly. # -*- coding:utf-8 -*- from retrying import retry import asyncio import time num = 0; def retry_if_result_none(result): return result is…
Yu Chen
  • 49
  • 4
1
vote
0 answers

retry decorator at Python

I'm trying to use retry decorator. It's working well, but when the maximum retries are reached an exception teaks place. How do I avoid this exception to return well from this situation, or how to return a value when this happens? import random from…
Itaybz
  • 63
  • 1
  • 6
1
vote
0 answers

Pulling data from a range

Looking for the script or formula to pull data from a range of houses on a separate sheet, based on the available sized home that can be built. Heres the initial process. We are calculating "Size of the block (m2)" eg.350m2 "R Code" (which…
1
vote
1 answer

How do I insert Backoff script into my web scrape

I want to use the package "Backoff" in my web scrape and I cannot get it to work. Where do I insert it?How to I get "r = requests..." to still be recognized? I've tried putting the statement into my code in various ways and it is not working. I want…
workin 4weekend
  • 371
  • 2
  • 11
0
votes
0 answers

Python Celery task with timeout - how to implement timeout with retries

I am new to Celery (5.1.xxx) and met someone else's code using celery task doing something in database (db) and retrying when it fails. @app.task(bind=True, max_retries=3) def build_my_task(self, xxx) try: state = do_something_in_db() …
jabba
  • 21
  • 2
0
votes
0 answers

retry logic on top of package object method call in python

I am using the azure-keyvault python package to authenticate with azure. I am trying to add retry logic to the api call client.get_secret(secretName) shown below. import os from azure.keyvault.secrets import SecretClient from azure.identity import…
3awny
  • 319
  • 1
  • 2
  • 10
0
votes
1 answer

Problems with installing plotly on Windows 10 with Python 3.8.5

I am having problems installing plotly on Windows 10 with Python 3.8.5. The command line prompt is in admin mode. The package manager pip3 here seems to be installing the package retrying-1.3.3 which is running into an error: ModuleNotFoundError:…
blizzardus
  • 13
  • 6
0
votes
1 answer

How to publish batched messages to a pubsub topic with retrying request

I've read all this doc : https://cloud.google.com/pubsub/docs/publisher there are 3 examples: Publishing to topic Publishing with batch mode Publishing with retrying requests I want to combine example 2 and 3 into single so publishing with batch…
0
votes
2 answers

Python retry alter behaviour

I have a function decorated with the @retry (from the retrying library), i want to alter the behaviour of the function to log more if this is a retry - is there a built in way to handle this? i.e. something like this: from retrying import…
Binyamin
  • 440
  • 1
  • 6
  • 12