1 parent c9d2ff6 commit 9ebb128Copy full SHA for 9ebb128
2 files changed
setup.py
@@ -14,6 +14,7 @@
14
'pendulum==1.2.0',
15
'simplejson==3.11.1',
16
'python-dateutil==2.6.0',
17
+ 'backoff==1.3.2',
18
],
19
packages=find_packages(),
20
package_data = {
singer/utils.py
@@ -6,6 +6,7 @@
6
import time
7
import dateutil
8
import pytz
9
+import backoff
10
11
from singer.catalog import Catalog
12
@@ -139,3 +140,12 @@ def check_config(config, required_keys):
139
140
missing_keys = [key for key in required_keys if key not in config]
141
if missing_keys:
142
raise Exception("Config is missing required keys: {}".format(missing_keys))
143
+
144
145
+def backoff(exceptions, giveup):
146
+ return backoff.on_exception(
147
+ backoff.expo,
148
+ exceptions,
149
+ max_tries=5,
150
+ giveup=giveup,
151
+ factor=2)
0 commit comments