Skip to content

Commit b55830b

Browse files
author
soconnor71
committed
TNR-1804: Switched backoff to retry for gunicorn compatibility
1 parent 91d1952 commit b55830b

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ backoff = "*"
88
pendulum = "*"
99
requests = "*"
1010
pytest = "*"
11+
retry = "*"
1112

1213
[requires]
1314
python_version = "3.6"

Pipfile.lock

Lines changed: 22 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
license='MIT',
1010
install_requires=[
1111
'pendulum==2.*',
12-
'backoff~=1.6',
13-
'requests>=2.20.0'
12+
'requests>=2.20.0',
13+
'retry==0.9.*'
1414
],
1515
long_description=open('README.md').read()
1616
)

vacasa/connect/connect.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"""Vacasa Connect Python SDK."""
2+
from retry import retry
23
import hashlib
34
import hmac
4-
from typing import Optional
5-
from urllib.parse import urlparse, urlunparse
6-
7-
import backoff
85
import pendulum
96
import requests
7+
from typing import Optional
8+
from urllib.parse import urlparse, urlunparse
109

1110

1211
def is_https_url(url: str) -> bool:
@@ -130,8 +129,7 @@ def _generate_signature(self, timestamp: int) -> str:
130129
return hmac.new(secret, message, hashlib.sha256).hexdigest()
131130

132131
@staticmethod
133-
@backoff.on_exception(backoff.fibo,
134-
requests.exceptions.RequestException, max_tries=5)
132+
@retry(exceptions=requests.exceptions.RequestException, tries=5, delay=1, backoff=2)
135133
def _get(url, headers: dict = None, params: dict = None):
136134
"""HTTP GET request helper."""
137135
if headers is None:

0 commit comments

Comments
 (0)