if config['db_name']:
for dbname in config['db_name'].split(','):
- db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
+ db, pool = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
cr = db.cursor()
if config["test_file"]:
openerp.tools.convert_yaml_import(cr, 'base', file(config["test_file"]), {}, 'test', True)
cr.rollback()
- # jobs will start to be processed later, when openerp.cron.start_master_thread below is called.
- registry.schedule_cron_jobs()
+ pool.get('ir.cron')._poolJobs(db.dbname)
cr.close()
if config["stop_after_init"]:
sys.exit(0)
-openerp.cron.start_master_thread()
+openerp.netsvc.start_agent()
#----------------------------------------------------------
# Launch Servers
signal.signal(signal.SIGQUIT, dumpstacks)
def quit():
- # stop scheduling new jobs; we will have to wait for the jobs to complete below
- openerp.cron.cancel_all()
+ openerp.netsvc.Agent.quit()
openerp.netsvc.Server.quitAll()
if config['pidfile']:
os.unlink(config['pidfile'])
if thread != threading.currentThread() and not thread.isDaemon():
while thread.isAlive():
# need a busyloop here as thread.join() masks signals
- # and would prevent the forced shutdown
+ # and would present the forced shutdown
thread.join(0.05)
time.sleep(0.05)
- openerp.modules.registry.RegistryManager.delete_all()
sys.exit(0)
if config['pidfile']: