sammchardy / python-kucoin

Kucoin REST and Websocket API python implementation
https://python-kucoin.readthedocs.io/en/latest/
MIT License
349 stars 147 forks source link

fixing send_ping never called (closes #56) #59

Closed MarcelBeining closed 5 years ago

MarcelBeining commented 5 years ago

The former implementation always called ReconnectingWebsocket's ``send_pingmethod if no update message was received from kucoin for 9 seconds. If this is not the case (i.e. regular messages from kucoin) Kucoin disconnects the websocket after 1 minute because no ping was sent. ReconnectingWebsocket'srun loop then receives a connection closed error and reconnects, which means some messages until reconnection might get lost and reconnecting is also inefficient. I changed the way send_pingis called correspondingly to assure that it is sent every 9 seconds, regardless of the amount of received message.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.2%) to 27.255% when pulling 1c2704044e792ea8db3fba9d97ad05d25343ea26 on MarcelBeining:master into c27a470b114d12628e18788bde14c0530182c2e5 on sammchardy:master.

sammchardy commented 5 years ago

Thanks @MarcelBeining