Skip to content

Commit

Permalink
add stop() call to gracefully exit the bot (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
gconklin authored Apr 24, 2024
1 parent bf834cd commit 096ba8f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webex_bot/websockets/webex_websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ def _get_device_info(self, check_existing=True):
logger.debug(f"self.device_info: {self.device_info}")
return resp


def stop(self):
def terminate():
raise SystemExit()

asyncio.get_event_loop().create_task(terminate())


def run(self):
if self.device_info is None:
if self._get_device_info() is None:
Expand Down

0 comments on commit 096ba8f

Please sign in to comment.