librelist archives

« back to archive

cleanly exiting in flask

cleanly exiting in flask

From:
Chengi Liu
Date:
2013-02-20 @ 06:07
Hi,
  First of all , I would like to thank this community for all their help
and support so far.
I don't have any glaring issue this time but i was just wondering if while
developing an app in flask, there is a better way to shut down the server
so that next time, I dont have to kill open ports.
Right now, I am debuging a lot.. so everytime i use ctrl + c (or z) to kill
the current run.. but it offcourse doesnt kills the code but send it to
background..
so next time, i always have to kill the open ports.
I was wondering, how do you guys solve this issue.
Thanks

Re: [flask] cleanly exiting in flask

From:
Steven Kryskalla
Date:
2013-02-22 @ 06:44
On Tue, Feb 19, 2013 at 10:07 PM, Chengi Liu <chengi.liu.86@gmail.com> wrote:
> I don't have any glaring issue this time but i was just wondering if while
> developing an app in flask, there is a better way to shut down the server so
> that next time, I dont have to kill open ports.
> Right now, I am debuging a lot.. so everytime i use ctrl + c (or z) to kill
> the current run.. but it offcourse doesnt kills the code but send it to
> background..
> so next time, i always have to kill the open ports.
> I was wondering, how do you guys solve this issue.

Ctrl+Z will leave the port in use because the process is still running
(just in a stopped state), but Ctrl+C should exit cleanly and make the
port free. What OS are you using? Are you doing anything in your app
or the way you are starting up / shutting down which could cause it to
still run in the background? Are you using the debugger/reloader?

Re: [flask] cleanly exiting in flask

From:
anh le
Date:
2013-02-22 @ 02:19
Hi Chengi,

if you're debugging a lot I think flask-failsafe probably helps.
Look at this thread:

http://flask.pocoo.org/mailinglist/archive/2012/9/15/avoid-reloader-crashes-with-flask-failsafe/


On Wed, Feb 20, 2013 at 1:07 PM, Chengi Liu <chengi.liu.86@gmail.com> wrote:
> Hi,
>   First of all , I would like to thank this community for all their help and
> support so far.
> I don't have any glaring issue this time but i was just wondering if while
> developing an app in flask, there is a better way to shut down the server so
> that next time, I dont have to kill open ports.
> Right now, I am debuging a lot.. so everytime i use ctrl + c (or z) to kill
> the current run.. but it offcourse doesnt kills the code but send it to
> background..
> so next time, i always have to kill the open ports.
> I was wondering, how do you guys solve this issue.
> Thanks
>