Update api.py
This commit is contained in:
parent
4d51ad53c0
commit
2a5680c16d
@ -31,7 +31,7 @@ class Api:
|
|||||||
def request(self, method, path, data=None, need_token=True, params={}):
|
def request(self, method, path, data=None, need_token=True, params={}):
|
||||||
try:
|
try:
|
||||||
return self.request_once(method, path, data, need_token, params)
|
return self.request_once(method, path, data, need_token, params)
|
||||||
except ApiLimitError:
|
except (ApiLimitError, requests.exception.Timeout):
|
||||||
print('oops, hit the limit. take a break')
|
print('oops, hit the limit. take a break')
|
||||||
sleep(10)
|
sleep(10)
|
||||||
return self.request_once(method, path, data, need_token, params)
|
return self.request_once(method, path, data, need_token, params)
|
||||||
|
Loading…
Reference in New Issue
Block a user