--- a/server/hook.py Wed May 09 16:35:46 2012 +0200
+++ b/server/hook.py Wed May 09 16:43:48 2012 +0200
@@ -273,7 +273,8 @@
RELATIONS_HOOKS = set(('before_add_relation', 'after_add_relation' ,
'before_delete_relation','after_delete_relation'))
SYSTEM_HOOKS = set(('server_backup', 'server_restore',
- 'server_startup', 'server_maintenance', 'server_shutdown',
+ 'server_startup', 'server_maintenance',
+ 'server_shutdown', 'before_server_shutdown',
'session_open', 'session_close'))
ALL_HOOKS = ENTITIES_HOOKS | RELATIONS_HOOKS | SYSTEM_HOOKS
--- a/server/repository.py Wed May 09 16:35:46 2012 +0200
+++ b/server/repository.py Wed May 09 16:43:48 2012 +0200
@@ -425,6 +425,10 @@
connections
"""
assert not self.shutting_down, 'already shutting down'
+ if not (self.config.creating or self.config.repairing
+ or self.config.quick_start):
+ # then, the system source is still available
+ self.hm.call_hooks('before_server_shutdown', repo=self)
self.shutting_down = True
self.system_source.shutdown()
if self._tasks_manager is not None: