equal
deleted
inserted
replaced
207 # needed (for instance looking for persistent configuration using an |
207 # needed (for instance looking for persistent configuration using an |
208 # internal session, which is not possible until pools have been |
208 # internal session, which is not possible until pools have been |
209 # initialized) |
209 # initialized) |
210 for source in self.sources: |
210 for source in self.sources: |
211 source.init() |
211 source.init() |
212 # call application level initialisation hooks |
|
213 self.hm.call_hooks('server_startup', repo=self) |
|
214 # register a task to cleanup expired session |
|
215 self.looping_task(self.config['session-time']/3., |
|
216 self.clean_sessions) |
|
217 else: |
212 else: |
218 # call init_creating so for instance native source can configurate |
213 # call init_creating so for instance native source can configurate |
219 # tsearch according to postgres version |
214 # tsearch according to postgres version |
220 for source in self.sources: |
215 for source in self.sources: |
221 source.init_creating() |
216 source.init_creating() |
223 # initialization now that we know cubes |
218 # initialization now that we know cubes |
224 self._get_pool().close(True) |
219 self._get_pool().close(True) |
225 for i in xrange(config['connections-pool-size']): |
220 for i in xrange(config['connections-pool-size']): |
226 self._available_pools.put_nowait(ConnectionsPool(self.sources)) |
221 self._available_pools.put_nowait(ConnectionsPool(self.sources)) |
227 self._shutting_down = False |
222 self._shutting_down = False |
|
223 if not config.creating: |
|
224 # call application level initialisation hooks |
|
225 self.hm.call_hooks('server_startup', repo=self) |
|
226 # register a task to cleanup expired session |
|
227 self.looping_task(self.config['session-time']/3., |
|
228 self.clean_sessions) |
228 |
229 |
229 # internals ############################################################### |
230 # internals ############################################################### |
230 |
231 |
231 def get_source(self, uri, source_config): |
232 def get_source(self, uri, source_config): |
232 source_config['uri'] = uri |
233 source_config['uri'] = uri |