[repo] don't call server_shutdown hooks when creating/repairing instance to be consistence with server_startup hooks stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 18 Mar 2010 17:33:03 +0100
branchstable
changeset 4946 2654cd5c87e0
parent 4942 8f4002f41b26
child 4947 c3ded0287295
[repo] don't call server_shutdown hooks when creating/repairing instance to be consistence with server_startup hooks
server/repository.py
--- a/server/repository.py	Thu Mar 18 17:16:17 2010 +0100
+++ b/server/repository.py	Thu Mar 18 17:33:03 2010 +0100
@@ -338,7 +338,8 @@
             self.info('waiting thread %s...', thread.name)
             thread.join()
             self.info('thread %s finished', thread.name)
-        self.hm.call_hooks('server_shutdown', repo=self)
+        if not (self.config.creating or self.config.repairing):
+            self.hm.call_hooks('server_shutdown', repo=self)
         self.close_sessions()
         while not self._available_pools.empty():
             pool = self._available_pools.get_nowait()