#343379: disturbing message on upgrade stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 26 May 2009 11:01:23 +0200
branchstable
changeset 1939 67e7379edd96
parent 1937 fc702ea02b25
child 1940 2565aae48d48
#343379: disturbing message on upgrade
server/repository.py
--- a/server/repository.py	Tue May 26 09:31:15 2009 +0200
+++ b/server/repository.py	Tue May 26 11:01:23 2009 +0200
@@ -636,9 +636,10 @@
             self.exception('unexpected error')
             raise
 
-    def close(self, sessionid):
+    def close(self, sessionid, checkshuttingdown=True):
         """close the session with the given id"""
-        session = self._get_session(sessionid, setpool=True)
+        session = self._get_session(sessionid, setpool=True,
+                                    checkshuttingdown=checkshuttingdown)
         # operation uncommited before close are rollbacked before hook is called
         session.rollback()
         self.hm.call_hooks('session_close', session=session)
@@ -691,7 +692,7 @@
         """close every opened sessions"""
         for sessionid in self._sessions.keys():
             try:
-                self.close(sessionid)
+                self.close(sessionid, checkshuttingdown=False)
             except:
                 self.exception('error while closing session %s' % sessionid)
 
@@ -720,9 +721,9 @@
         session.set_pool()
         return session
 
-    def _get_session(self, sessionid, setpool=False):
+    def _get_session(self, sessionid, setpool=False, checkshuttingdown=True):
         """return the user associated to the given session identifier"""
-        if self._shutting_down:
+        if checkshuttingdown and self._shutting_down:
             raise Exception('Repository is shutting down')
         try:
             session = self._sessions[sessionid]