开发者

Is there a way to programmatically stop web.py?

开发者 https://www.devze.com 2023-02-19 09:25 出处:网络
I\'m trying to run web.application in a Windows Service and I cannot find a way to programmatically stop it after application.r开发者_高级运维un().

I'm trying to run web.application in a Windows Service and I cannot find a way to programmatically stop it after application.r开发者_高级运维un().

I tried sys.exit and it didn't work well with Windows Service.


I solved the question I originally raised by looking into web.py source code, and exposed the WSGIServer in web/httpserver.py to web/application.py, so that i can call WSGIServer.stop() in application.stop(), which is added by myself.

It's a quick hack and not that neat, but it removed the blocker quickly.

0

精彩评论

暂无评论...
验证码 换一张
取 消