From a659d1fa8c65211dbe98c57156f3cd54a61b6fa9 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Thu, 21 Apr 2011 17:58:36 +0200 Subject: [PATCH] [REF] netsvc: explicit Agent thread creation. bzr revid: vmt@openerp.com-20110421155836-70da1nhpb38zqbls --- openerp-server | 2 ++ openerp/netsvc.py | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openerp-server b/openerp-server index a5c81d6593e..3adf5e6f574 100755 --- a/openerp-server +++ b/openerp-server @@ -150,6 +150,8 @@ if config["translate_in"]: if config["stop_after_init"]: sys.exit(0) +openerp.netsvc.start_agent() + #---------------------------------------------------------- # Launch Servers #---------------------------------------------------------- diff --git a/openerp/netsvc.py b/openerp/netsvc.py index 9d3e338a9e1..0cc1870edb7 100644 --- a/openerp/netsvc.py +++ b/openerp/netsvc.py @@ -277,12 +277,13 @@ class Agent(object): time.sleep(1) time.sleep(60) -agent_runner = threading.Thread(target=Agent.runner, name="netsvc.Agent.runner") -# the agent runner is a typical daemon thread, that will never quit and must be -# terminated when the main process exits - with no consequence (the processing -# threads it spawns are not marked daemon) -agent_runner.setDaemon(True) -agent_runner.start() +def start_agent(): + agent_runner = threading.Thread(target=Agent.runner, name="netsvc.Agent.runner") + # the agent runner is a typical daemon thread, that will never quit and must be + # terminated when the main process exits - with no consequence (the processing + # threads it spawns are not marked daemon) + agent_runner.setDaemon(True) + agent_runner.start() import traceback