fbradyirl / webex_bot

Python package for a Webex Bot based on websockets.
MIT License
68 stars 44 forks source link

add stop() call to gracefully exit the bot #42

Closed gconklin closed 4 months ago

gconklin commented 11 months ago

when using the bot framework in a service, I needed a way to gracefully stop the process loop from an external trigger.

bot = WebexBot(...)

def graceful_exit()
    cysystemd.daemon.notify(cysystemd.daemon.Notification.STOPPING)
    bot.stop()

signal.signal(signal.SIGTERM, graceful_exit)
bot.run()