Update api.py
This commit is contained in:
parent
2a5680c16d
commit
35bc586b72
@ -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, requests.exception.Timeout):
|
except (ApiLimitError, requests.exceptions.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