[IMP] openerp-server: catch db init errors to avoid exiting main thread
bzr revid: odo@openerp.com-20110923143223-4c9gofbml7w2gimo
This commit is contained in:
parent
029a636f4e
commit
008cc8e385
|
@ -88,8 +88,11 @@ def setup_pid_file():
|
|||
|
||||
def preload_registry(dbname):
|
||||
""" Preload a registry, and start the cron."""
|
||||
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."""
|
||||
|
|
Loading…
Reference in New Issue