Skip to content

Commit

Permalink
fix: websocket callback errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloHiro committed Oct 22, 2024
1 parent 764dcbf commit 2a20a0b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions awxkit/awxkit/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ def unsubscribe(self, wait=True, timeout=10):
else:
self._send(json.dumps(dict(groups={}, xrftoken=self.csrftoken)))

def _on_message(self, message):
message = json.loads(message)
def _on_message(self, *args):
message = json.loads(args[1])
log.debug('received message: {}'.format(message))
if self._add_received_time:
message['received_time'] = datetime.datetime.utcnow()
Expand All @@ -230,13 +230,13 @@ def _update_subscription(self, job_id):
self.subscribe(**subscription)
self._should_subscribe_to_pending_job = False

def _on_open(self):
def _on_open(self, *args):
self._ws_connected_flag.set()

def _on_error(self, error):
log.info('Error received: {}'.format(error))
def _on_error(self, *args):
log.info('Error received: {}'.format(args[1]))

def _on_close(self):
def _on_close(self, *args):
log.info('Successfully closed ws.')
self._ws_closed = True

Expand Down

0 comments on commit 2a20a0b

Please sign in to comment.