Skip to content

Commit 0297d97

Browse files
authored
Merge pull request #1089 from sphinx-contrib/retry-on-transient-errors
rest: adjust publish retry events based on transient errors
2 parents 11f9ba7 + 440b016 commit 0297d97

File tree

1 file changed

+4
-2
lines changed
  • sphinxcontrib/confluencebuilder

1 file changed

+4
-2
lines changed

sphinxcontrib/confluencebuilder/rest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ def _wrapper(self, *args, **kwargs):
124124
if any(x in ex_str for x in API_NORETRY_ERRORS):
125125
raise
126126

127-
# Always retry on 5xx error codes.
128-
if ex.status_code >= 500 and ex.status_code <= 599:
127+
# Retry on transient errors.
128+
#
129+
# See: https://everything.curl.dev/usingcurl/downloads/retry.html#retry
130+
if ex.status_code in (408, 429, 500, 502, 503, 504):
129131
pass
130132
# Check if the reported state is a retry condition, but
131133
# Confluence does not report a 5xx error code for the

0 commit comments

Comments
 (0)