server/repository.py
changeset 8351 02f4f01375e8
parent 8322 cb838b126b07
child 8366 6599f69bb846
--- a/server/repository.py	Wed Apr 04 16:51:09 2012 +0200
+++ b/server/repository.py	Tue Apr 10 17:07:03 2012 +0200
@@ -429,13 +429,13 @@
         self.system_source.shutdown()
         if self._tasks_manager is not None:
             self._tasks_manager.stop()
+        if not (self.config.creating or self.config.repairing
+                or self.config.quick_start):
+            self.hm.call_hooks('server_shutdown', repo=self)
         for thread in self._running_threads:
             self.info('waiting thread %s...', thread.getName())
             thread.join()
             self.info('thread %s finished', thread.getName())
-        if not (self.config.creating or self.config.repairing
-                or self.config.quick_start):
-            self.hm.call_hooks('server_shutdown', repo=self)
         self.close_sessions()
         while not self._cnxsets_pool.empty():
             cnxset = self._cnxsets_pool.get_nowait()