You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Sanic==23.6.0, the handler for app.before_server_stop is not invoked when Ctrl+c is pressed on Windows. The same code works as expected on Linux (i.e. app.before_server_stop handler is invoked when Ctrl+c is pressed).
Is there an existing issue for this?
Describe the bug
In Sanic==23.6.0, the handler for app.before_server_stop is not invoked when Ctrl+c is pressed on Windows. The same code works as expected on Linux (i.e. app.before_server_stop handler is invoked when Ctrl+c is pressed).
Code snippet
Expected Behavior
When Ctrl+c is pressed, 456 should be printed on the screen. But I got the following output:
How do you run Sanic?
As a script (
app.run
orSanic.serve
)Operating System
Windows
Sanic Version
23.6.0
Additional context
Workaround is to set
single_process=True
and useSanic.serve_single()
to run the server. This way "456" is printed when Ctrl+c is pressed on Windows.The text was updated successfully, but these errors were encountered: