call server_startup hook once pools have been initialized stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Jun 2009 16:57:26 +0200
branchstable
changeset 2153 d42d1eaefcdd
parent 2152 edec2c9055e5
child 2156 fadb86b040a9
call server_startup hook once pools have been initialized
server/repository.py
--- a/server/repository.py	Tue Jun 23 16:31:15 2009 +0200
+++ b/server/repository.py	Wed Jun 24 16:57:26 2009 +0200
@@ -209,11 +209,6 @@
             # initialized)
             for source in self.sources:
                 source.init()
-            # call application level initialisation hooks
-            self.hm.call_hooks('server_startup', repo=self)
-            # register a task to cleanup expired session
-            self.looping_task(self.config['session-time']/3.,
-                              self.clean_sessions)
         else:
             # call init_creating so for instance native source can configurate
             # tsearch according to postgres version
@@ -225,6 +220,12 @@
         for i in xrange(config['connections-pool-size']):
             self._available_pools.put_nowait(ConnectionsPool(self.sources))
         self._shutting_down = False
+        if not config.creating:
+            # call application level initialisation hooks
+            self.hm.call_hooks('server_startup', repo=self)
+            # register a task to cleanup expired session
+            self.looping_task(self.config['session-time']/3.,
+                              self.clean_sessions)
 
     # internals ###############################################################