Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comitting potential fix for the timeout #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions huobi/connection/impl/restapi_invoker.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def check_response(dict_data):
def call_sync(request, is_checked=False):
if request.method == "GET":
# print("call_sync url : " , request.host + request.url)
response = session.get(request.host + request.url, headers=request.header)
response = session.get(request.host + request.url, headers=request.header, timeout=(2,10))
if is_checked is True:
return response.text
dict_data = json.loads(response.text, encoding="utf-8")
Expand All @@ -59,7 +59,7 @@ def call_sync(request, is_checked=False):
return request.json_parser(dict_data)

elif request.method == "POST":
response = session.post(request.host + request.url, data=json.dumps(request.post_body), headers=request.header)
response = session.post(request.host + request.url, data=json.dumps(request.post_body), headers=request.header, timeout=(2,10))
dict_data = json.loads(response.text, encoding="utf-8")
# print("call_sync === recv data : ", dict_data)
check_response(dict_data)
Expand Down
2 changes: 0 additions & 2 deletions huobi/connection/restapi_sync_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

from huobi.exception.huobi_api_exception import HuobiApiException



class RestApiSyncClient(object):

def __init__(self, **kwargs):
Expand Down