Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce-worker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ecommerce-worker
Commits
161bb56d
Commit
161bb56d
authored
Feb 02, 2017
by
Simon Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 104 to be part of the retry error ECOM-7042
parent
e7ab02da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
ecommerce_worker/sailthru/v1/tasks.py
+4
-3
ecommerce_worker/sailthru/v1/tests/test_tasks.py
+6
-0
No files found.
ecommerce_worker/sailthru/v1/tasks.py
View file @
161bb56d
...
...
@@ -210,8 +210,9 @@ def can_retry_sailthru_request(error):
""" Returns True if a Sailthru request and be re-submitted after an error has occurred.
Responses with the following codes can be retried:
9: Internal Error
43: Too many [type] requests this minute to /[endpoint] API
9: Internal Error
43: Too many [type] requests this minute to /[endpoint] API
104: Connection reset by peer
All other errors are considered failures, that should not be retried. A complete list of error codes is available at
https://getstarted.sailthru.com/new-for-developers-overview/api/api-response-errors/.
...
...
@@ -223,7 +224,7 @@ def can_retry_sailthru_request(error):
bool: Indicates if the original request can be retried.
"""
code
=
error
.
get_error_code
()
return
code
in
(
9
,
43
)
return
code
in
(
9
,
43
,
104
)
@shared_task
(
bind
=
True
,
ignore_result
=
True
)
...
...
ecommerce_worker/sailthru/v1/tests/test_tasks.py
View file @
161bb56d
...
...
@@ -559,6 +559,12 @@ class SailthruTests(TestCase):
self
.
assertFalse
(
_update_unenrolled_list
(
mock_sailthru_client
,
TEST_EMAIL
,
self
.
course_url
,
False
))
mock_sailthru_client
.
reset_mock
()
# simulate retryable error
mock_sailthru_client
.
api_get
.
return_value
=
MockSailthruResponse
({},
error
=
'Connection reset by peer'
,
code
=
104
)
self
.
assertFalse
(
_update_unenrolled_list
(
mock_sailthru_client
,
TEST_EMAIL
,
self
.
course_url
,
False
))
# test get error from Sailthru
mock_sailthru_client
.
reset_mock
()
# simulate unretryable error
...
...
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