Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop/terminate flask outside request context #1807

Closed
ghost opened this issue May 13, 2016 · 5 comments
Closed

stop/terminate flask outside request context #1807

ghost opened this issue May 13, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented May 13, 2016

is it possible to stop flask outside request context ? as i know there's no way for it .

maybe a function( stop() ) that changes a flag( shutdown_signal=False ==> True ) for werkzeug that stops server for listening on new connections ?
i can contribute on making this feature if you allow me ...

@ThiefMaster
Copy link
Member

ThiefMaster commented May 13, 2016

Why do you want this? app.run() is only meant for development anyway - and there you could simpy os.kill() the process if you want to terminate it.

@ghost
Copy link
Author

ghost commented May 13, 2016

i am developing a thing that use flask in another thread (maybe i should bring it to main one) ... i should try os.kill() i guess ...

@ThiefMaster
Copy link
Member

Using app.run()? Sound like a bad idea.

@ghost
Copy link
Author

ghost commented May 13, 2016

what about using cherrypy server since werkzeug is only for development ?
http://flask.pocoo.org/snippets/24/

@ghost
Copy link
Author

ghost commented May 13, 2016

using cherrypy server worked well for me ... thanks

@ghost ghost closed this as completed May 13, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant