427 assert not self.shutting_down, 'already shutting down' |
427 assert not self.shutting_down, 'already shutting down' |
428 self.shutting_down = True |
428 self.shutting_down = True |
429 self.system_source.shutdown() |
429 self.system_source.shutdown() |
430 if self._tasks_manager is not None: |
430 if self._tasks_manager is not None: |
431 self._tasks_manager.stop() |
431 self._tasks_manager.stop() |
|
432 if not (self.config.creating or self.config.repairing |
|
433 or self.config.quick_start): |
|
434 self.hm.call_hooks('server_shutdown', repo=self) |
432 for thread in self._running_threads: |
435 for thread in self._running_threads: |
433 self.info('waiting thread %s...', thread.getName()) |
436 self.info('waiting thread %s...', thread.getName()) |
434 thread.join() |
437 thread.join() |
435 self.info('thread %s finished', thread.getName()) |
438 self.info('thread %s finished', thread.getName()) |
436 if not (self.config.creating or self.config.repairing |
|
437 or self.config.quick_start): |
|
438 self.hm.call_hooks('server_shutdown', repo=self) |
|
439 self.close_sessions() |
439 self.close_sessions() |
440 while not self._cnxsets_pool.empty(): |
440 while not self._cnxsets_pool.empty(): |
441 cnxset = self._cnxsets_pool.get_nowait() |
441 cnxset = self._cnxsets_pool.get_nowait() |
442 try: |
442 try: |
443 cnxset.close(True) |
443 cnxset.close(True) |