Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
dd3395ea
Commit
dd3395ea
authored
Mar 01, 2001
by
rbmead
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added exponential backoff to supports_retry to allow time for conflict error to be
resolved before retrying.
parent
2bf4f5ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+6
-3
No files found.
lib/python/ZPublisher/HTTPRequest.py
View file @
dd3395ea
...
...
@@ -83,9 +83,9 @@
#
##############################################################################
__version__
=
'$Revision: 1.4
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
6
$'
[
11
:
-
2
]
import
regex
,
re
,
sys
,
os
,
string
,
urllib
import
regex
,
re
,
sys
,
os
,
string
,
urllib
,
time
,
whrandom
from
string
import
lower
,
atoi
,
rfind
,
split
,
strip
,
join
,
upper
,
find
from
BaseRequest
import
BaseRequest
from
HTTPResponse
import
HTTPResponse
...
...
@@ -175,7 +175,10 @@ class HTTPRequest(BaseRequest):
_urls
=
()
retry_max_count
=
3
def
supports_retry
(
self
):
return
self
.
retry_count
<
self
.
retry_max_count
def
supports_retry
(
self
):
if
self
.
retry_count
<
self
.
retry_max_count
:
time
.
sleep
(
whrandom
.
uniform
(
0
,
2
**
(
self
.
retry_count
)))
return
1
def
retry
(
self
):
self
.
retry_count
=
self
.
retry_count
+
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment