[FIX] startup: when preloading a registry with the -d option, document_webdav
authorVo Minh Thu <vmt@openerp.com>
Mon, 5 Sep 2011 10:36:19 +0000 (12:36 +0200)
committerVo Minh Thu <vmt@openerp.com>
Mon, 5 Sep 2011 10:36:19 +0000 (12:36 +0200)
could not register itself because the refactoring of the startup
script run the services after the registry preloading. I would
still prefer to start the services after, but we first need the
required hooks in the addons, which would allow us to remove any
side-effecting code from them.

bzr revid: vmt@openerp.com-20110905103619-vhp1goqy7w1nmefu

openerp-server

index 2698307..dbae1c3 100755 (executable)
@@ -252,6 +252,11 @@ if __name__ == "__main__":
         import_translation()
         sys.exit(0)
 
+    if not config["stop_after_init"]:
+        # Some module register themselves when they are loaded so we need the
+        # services to be running before loading any registry.
+        start_services()
+
     if config['db_name']:
         for dbname in config['db_name'].split(','):
             preload_registry(dbname)
@@ -261,7 +266,6 @@ if __name__ == "__main__":
 
     setup_pid_file()
     setup_signal_handlers()
-    start_services()
     logger = logging.getLogger('server')
     logger.info('OpenERP server is running, waiting for connections...')
     quit_on_signals()