Re: Execute engine.restart() in thread hangs

Ryan Tennill <[email protected]> Mon, 5 Mar 2018 21:41:33 -0800 (PST)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
On Friday, December 16, 2016 at 10:37:36 AM UTC-6, Steven Sawyer wrote:
>
> I'm working on a user-hosted application that needs to periodically check 
> for updates, apply them, then restart.
>
> I have the update checker/installer running in a separate thread, but I 
> can't get it to restart the server. It seems as though calling 
> cherrypy.engine.restart() inside a child thread makes the server hang 
> waiting for that thread to terminate so it can completely shut down. And 
> that thread won't terminate until the restart() call finishes.
>
> Is there a good way to call a server restart from a child thread?
>

How are you deploying/managing your applicaton? If you're using the built 
in server and autoreloader then you can simply 'touch' a file that's being 
served and it will restart the server. 

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.