Reputation: 51
After a simple query
k.query_public('Ticker', {'pair' : 'GNOETH'})['result']['GNOETH']['b'][0])
if I'm getting a time-out or other exception like 504, the next query and all next queries in my cycle are getting this exception:
http.client.CannotSendRequest: Request-sent
How can I prevent this?
Upvotes: 2
Views: 528
Reputation: 159
Try also to ensure that the value of "nonce" is set to 0 at the api-key creation.
Upvotes: 0
Reputation: 51
I've got an answer - you have to close a connection with k.conn.close() in exception:
while True:
try:
trades = k.query_public('Trades', {'pair' : 'ETHUSD'})
return trades
break
except Exception as ex:
k.conn.close()
Upvotes: 3