Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fastpurge/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ class FastPurgeClient(object):
MAX_RETRIES = int(os.environ.get("FAST_PURGE_MAX_RETRIES", "10"))

RETRY_BACKOFF = float(os.environ.get("FAST_PURGE_RETRY_BACKOFF", "0.15"))
RETRY_BACKOFF_MAX = float(os.environ.get("FAST_PURGE_RETRY_BACKOFF_MAX", "150"))
RETRY_BACKOFF_JITTER = float(os.environ.get("FAST_PURGE_RETRY_JITTER", "2"))

# Default purge type.
# Akamai recommend "invalidate", so why is "delete" our default?
# Here's what Akamai docs have to say:
Expand Down Expand Up @@ -235,6 +238,8 @@ def __retry_policy(self):
retries = LoggingRetry(
total=self.MAX_RETRIES,
backoff_factor=self.RETRY_BACKOFF,
backoff_max=self.RETRY_BACKOFF_MAX,
backoff_jitter=self.RETRY_BACKOFF_JITTER,
# We strictly require 201 here since that's how the server
# tells us we queued something async, as expected
status_forcelist=[status.value for status in HTTPStatus
Expand Down