Skip to content

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

Merged
fbradyirl merged 1 commit into
fbradyirl:mainfrom
gconklin:graceful-stop
Apr 24, 2024
Merged

add stop() call to gracefully exit the bot#42
fbradyirl merged 1 commit into
fbradyirl:mainfrom
gconklin:graceful-stop

Conversation

@gconklin

Copy link
Copy Markdown
Contributor

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

@fbradyirl fbradyirl merged commit 096ba8f into fbradyirl:main Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants