Skip to content
Snippets Groups Projects
Commit 008cc8e3 authored by Olivier Dony's avatar Olivier Dony
Browse files

[IMP] openerp-server: catch db init errors to avoid exiting main thread

bzr revid: odo@openerp.com-20110923143223-4c9gofbml7w2gimo
parent 029a636f
No related branches found
No related tags found
No related merge requests found
......@@ -88,8 +88,11 @@ def setup_pid_file():
def preload_registry(dbname):
""" Preload a registry, and start the cron."""
db, pool = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
pool.get('ir.cron').restart(db.dbname)
try:
db, pool = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
pool.get('ir.cron').restart(db.dbname)
except Exception:
logging.exception('Failed to initialize database `%s`.', dbname)
def run_test_file(dbname, test_file):
""" Preload a registry, possibly run a test file, and start the cron."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment