KERNEL: fix ir.cron must start only once instance when server run with update args

bzr revid: ced-bd7423814d9f1526baa475e379e897de732dd768
This commit is contained in:
ced 2007-06-26 09:43:20 +00:00
parent f94600c862
commit feddc3e6e7
2 changed files with 2 additions and 7 deletions

View File

@ -162,11 +162,7 @@ class Agent(object):
def setAlarm(self, fn, dt, args=[], kwargs={}):
wait = dt - time.time()
if wait > 0:
self._logger.notifyChannel(
'timers', LOG_DEBUG,
"Job scheduled in %s seconds for %s.%s" % (wait,
fn.im_class.__name__,
fn.func_name))
self._logger.notifyChannel('timers', LOG_DEBUG, "Job scheduled in %s seconds for %s.%s" % (wait, fn.im_class.__name__, fn.func_name))
timer = threading.Timer(wait, fn, args, kwargs)
timer.start()
self._timers.append(timer)

View File

@ -53,8 +53,7 @@ def get_db_and_pool(db_name, force_demo=False, status={}, update_module=False):
if not update_module:
import report
report.interface.register_all(db)
pool.get('ir.cron')._poolJobs(db.dbname)
pool.get('ir.cron')._poolJobs(db.dbname)
return db, pool
def restart_pool(db_name, force_demo=False, update_module=False):