webex_bot icon indicating copy to clipboard operation
webex_bot copied to clipboard

add stop() call to gracefully exit the bot

Open gconklin opened this issue 1 year ago • 0 comments

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()

gconklin avatar Sep 13 '23 14:09 gconklin