Commit b0518bcc3f5b07515590be8c171beb144e3c51c8

Authored by ivanka12
1 parent 0fca86ca

update retry_if_request_failed

@@ -11,12 +11,10 @@ import os @@ -11,12 +11,10 @@ import os
11 import urllib 11 import urllib
12 12
13 def retry_if_request_failed(exception): 13 def retry_if_request_failed(exception):
14 - if isinstance(exception, RequestFailed):  
15 - status_code = getattr(exception, 'status_int', None)  
16 - if 500 <= status_code < 600 or status_code in (409, 429):  
17 - return True  
18 - else:  
19 - return False 14 + status_code = getattr(exception, 'status_code', None)
  15 + print(status_code)
  16 + if 500 <= status_code < 600 or status_code in (409, 429, 412):
  17 + return True
20 else: 18 else:
21 return isinstance(exception, BadStatusLine) 19 return isinstance(exception, BadStatusLine)
22 20
Please register or login to post a comment