Skip to content

Commit 6ec402b

Browse files
committed
OpenAlex API call exponential backoff
1 parent ee08c21 commit 6ec402b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

recordthresher_refresh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import requests
99
from sqlalchemy.exc import NoResultFound
10-
from tenacity import retry, stop_after_attempt
10+
from tenacity import retry, stop_after_attempt, wait_fixed, wait_exponential
1111

1212
from pub import Pub
1313
from app import app, db
@@ -27,7 +27,7 @@ def doi_seen(doi):
2727
return doi in SEEN_DOIS
2828

2929

30-
@retry(stop=stop_after_attempt(5))
30+
@retry(stop=stop_after_attempt(10), wait=wait_exponential(multiplier=1, min=4, max=256))
3131
def get_openalex_json(url, params):
3232
r = requests.get(url, params=params,
3333
verify=False)

0 commit comments

Comments
 (0)