4643396: graceful shutdown tornado web server

Added 4 years ago by mywaiting

Love

12 Add your love!

Tags

Discussion

Simply to use SIGINT and SIGTERM to shutdown tornado web server gracefully.

When send the SIGINT and SIGTERM to the tornado server process, it will stop all http request, and then process all the callbacks and timeout events in IOLoop. After all, stop IOLoop and really shutdown.

Original by 生产环境下如何优雅地重启 Tornado

Make it to your code:

graceful_shutdown_tornado_web_server

You can catch it @mywaiting in weibo.com

OR follow me in twitter @mywaiting

:)

File: graceful_shutdown_tornado_web_server.py