Skip to content

Commit

Permalink
Fix retry_enabled=False config flag to correctly disable SDK retry logic
Browse files Browse the repository at this point in the history
This is needed because the retry logic in SDK doesn't work properly :-(
(see opsgenie#21)
  • Loading branch information
asqui committed Nov 6, 2019
1 parent 74dd84c commit 212d1cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opsgenie_sdk/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
wait=tenacity.wait_random_exponential(multiplier=configuration.back_off,
max=configuration.retry_max_delay,
min=configuration.retry_delay),
retry=(tenacity.retry_if_result(self.is_retry_enabled) and
retry=(tenacity.retry_if_result(self.is_retry_enabled) &
((tenacity.retry_if_exception_type(RetryableException)) |
(tenacity.retry_if_exception_type(HTTPError)))))

Expand All @@ -104,7 +104,7 @@ def __del__(self):
self._pool.join()
self._pool = None

def is_retry_enabled(self):
def is_retry_enabled(self, _):
return self.configuration.retry_enabled

@property
Expand Down

0 comments on commit 212d1cd

Please sign in to comment.