Skip to content

Commit 99f5111

Browse files
committed
Fixed bug, which resulted in callbacks not working
1 parent fea9d99 commit 99f5111

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python_bitvavo_api/bitvavo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def waitForReset(self, waitTime):
102102
debugToConsole('Ban should have been lifted, resetting rate limit to 1000.')
103103
else:
104104
timeToWait = (self.bitvavo.rateLimitReset / 1000) - time.time()
105-
debugToConsole('Ban took longer than expected, sleeping again for', timeToWait, 'seconds.')
105+
debugToConsole('Ban took longer than expected, sleeping again for ' + str(timeToWait) + ' seconds.')
106106
self.waitForReset(timeToWait)
107107

108108
def run(self):
@@ -412,7 +412,7 @@ def on_message(ws, msg):
412412
if('error' in callbacks):
413413
callbacks['error'](msg)
414414
else:
415-
errorToConsole(msg)
415+
errorToConsole(json.dumps(msg, indent=2))
416416

417417
if('action' in msg):
418418
if(msg['action'] == 'getTime'):
@@ -501,7 +501,7 @@ def on_message(ws, msg):
501501

502502
def on_error(ws, error):
503503
if('error' in callbacks):
504-
callbacks['error'](error)
504+
ws.callbacks['error'](error)
505505
else:
506506
errorToConsole(error)
507507

@@ -540,7 +540,7 @@ def on_open(self):
540540
if(self.APIKEY != ''):
541541
self.doSend(self.ws, json.dumps({ 'window':str(self.ACCESSWINDOW), 'action': 'authenticate', 'key': self.APIKEY, 'signature': createSignature(now, 'GET', '/websocket', {}, self.APISECRET), 'timestamp': now }))
542542
if self.reconnect:
543-
debugToConsole("we started reconnecting", self.checkReconnect)
543+
debugToConsole("we started reconnecting " + str(self.checkReconnect))
544544
thread = threading.Thread(target = self.checkReconnect)
545545
thread.start()
546546

0 commit comments

Comments
 (0)