ThreadedServer
Odoo服务器通过ThreadedServer.run()开始运行
ThreadedServer.run()
def run(self, preload=None, stop=False):
""" Start the http server and the cron thread then wait for a signal.
The first SIGINT or SIGTERM signal will initiate a graceful shutdown while
a second one if any will force an immediate exit.
"""
self.start(stop=stop)
rc = preload_registries(preload)
if stop:
self.stop()
return rc
# Wait for a first signal to be handled. (time.sleep will be interrupted
# by the signal handler.) The try/except is for the win32 case.
try:
while self.quit_signals_received == 0:
time.sleep(60)
except KeyboardInterrupt:
pass
self.stop()
ThreadedServer.start()
start()方法如下。
def start(self, stop=False):
_logger.debug("Setting signal handlers")
if os.name == 'posix':
signal.signal(signal.SIGINT, self.signal_handler)
signal.signal(signal.SIGTERM, self.signal_handler)
signal.signal(signal

本文深入探讨了Odoo的ThreadedServer运行机制,包括ThreadedServer.run(), start()和http_spawn()方法,以及ThreadedWSGIServerReloadable如何在Werkzeug库中工作。此外,介绍了openerp.service.wsgi_server中的application()和application_unproxied()函数在处理HTTP请求中的作用。"
45534075,1353407,Python验证码识别技术解析,"['Python', '验证码处理', '图像处理', '机器学习', '自动化']
最低0.47元/天 解锁文章
1421

被折叠的 条评论
为什么被折叠?



