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

Make subscriptionTicker + subscriptionTicker24h handle multiple markets #53

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add enabling ping/pong with parameters ping_interval/ping_timeout
cibcbv committed Jan 1, 2025
commit 2682c6dd66738d15eb4fb780d6c081a04208eb3a
13 changes: 11 additions & 2 deletions python_bitvavo_api/bitvavo.py
Original file line number Diff line number Diff line change
@@ -121,7 +121,10 @@ def __init__(self, ws, wsObject):
def run(self):
try:
while(self.wsObject.keepAlive):
self.ws.run_forever()
self.ws.run_forever(
ping_interval = self.wsObject.bitvavo.ping_interval,
ping_timeout = self.wsObject.bitvavo.ping_timeout
)
self.wsObject.reconnect = True
self.wsObject.authenticated = False
time.sleep(self.wsObject.reconnectTimer)
@@ -141,6 +144,8 @@ def __init__(self, options = {}):
self.rateLimitRemaining = 1000
self.rateLimitReset = 0
self.timeout = None
self.ping_interval = None
self.ping_timeout = None
global debugging
debugging = False
for key in options:
@@ -157,7 +162,11 @@ def __init__(self, options = {}):
elif key.lower() == "wsurl":
self.wsUrl = options[key]
elif key.lower() == "timeout":
self.timeout = options[key]
self.timeout = options[key]
elif key.lower() == "ping_interval":
self.ping_interval = options[key]
elif key.lower() == "ping_timeout":
self.ping_timeout = options[key]
if(self.ACCESSWINDOW == None):
self.ACCESSWINDOW = 10000