[IMP] netsvc.Agent: spawned task threads should not be marked as daemon

bzr revid: odo@openerp.com-20100922114525-sxl26m5ilum0uscj
This commit is contained in:
Olivier Dony 2010-09-22 13:45:25 +02:00
parent c7fedc09fd
commit c6d238654c
1 changed files with 4 additions and 1 deletions

View File

@ -348,7 +348,10 @@ class Agent(object):
current_thread.dbname = dbname # hack hack
cls._logger.notifyChannel('timers', LOG_DEBUG, "Run %s.%s(*%r, **%r)" % (function.im_class.__name__, function.func_name, args, kwargs))
delattr(current_thread, 'dbname')
threading.Thread(target=function, args=args, kwargs=kwargs).start()
task_thread = threading.Thread(target=function, name='netsvc.Agent.task', args=args, kwargs=kwargs)
# force non-daemon task threads (the runner thread must be daemon, and this property is inherited by default)
task_thread.daemon = False
task_thread.start()
time.sleep(1)
time.sleep(60)