server/repository.py
changeset 9404 3e3e9b37e177
parent 9402 2c48c091b6a2
child 9448 3e7cad3967c5
equal deleted inserted replaced
9403:d81207fb9499 9404:3e3e9b37e177
   514             cwuser.properties
   514             cwuser.properties
   515             return cwuser
   515             return cwuser
   516 
   516 
   517     # public (dbapi) interface ################################################
   517     # public (dbapi) interface ################################################
   518 
   518 
   519     @deprecated("[4.0] use _cw.call_service('repo_stats'")
   519     @deprecated("[3.19] use _cw.call_service('repo_stats'")
   520     def stats(self): # XXX restrict to managers session?
   520     def stats(self): # XXX restrict to managers session?
   521         """Return a dictionary containing some statistics about the repository
   521         """Return a dictionary containing some statistics about the repository
   522         resources usage.
   522         resources usage.
   523 
   523 
   524         This is a public method, not requiring a session id.
   524         This is a public method, not requiring a session id.
   526         This method is deprecated in favor of using _cw.call_service('repo_stats')
   526         This method is deprecated in favor of using _cw.call_service('repo_stats')
   527         """
   527         """
   528         with self.internal_session() as session:
   528         with self.internal_session() as session:
   529             return session.call_service('repo_stats')
   529             return session.call_service('repo_stats')
   530 
   530 
   531     @deprecated("[4.0] use _cw.call_service('repo_gc_stats'")
   531     @deprecated("[3.19] use _cw.call_service('repo_gc_stats'")
   532     def gc_stats(self, nmax=20):
   532     def gc_stats(self, nmax=20):
   533         """Return a dictionary containing some statistics about the repository
   533         """Return a dictionary containing some statistics about the repository
   534         memory usage.
   534         memory usage.
   535 
   535 
   536         This is a public method, not requiring a session id.
   536         This is a public method, not requiring a session id.
   937             if session.timestamp < mintime:
   937             if session.timestamp < mintime:
   938                 self.close(session.id)
   938                 self.close(session.id)
   939                 nbclosed += 1
   939                 nbclosed += 1
   940         return nbclosed
   940         return nbclosed
   941 
   941 
   942     @deprecated("[4.0] use internal_cnx now\n"
   942     @deprecated("[3.19] use internal_cnx now\n"
   943                 "(Beware that integrity hook are now enabled by default)")
   943                 "(Beware that integrity hook are now enabled by default)")
   944     def internal_session(self, cnxprops=None, safe=False):
   944     def internal_session(self, cnxprops=None, safe=False):
   945         """return a dbapi like connection/cursor using internal user which have
   945         """return a dbapi like connection/cursor using internal user which have
   946         every rights on the repository. The `safe` argument is a boolean flag
   946         every rights on the repository. The `safe` argument is a boolean flag
   947         telling if integrity hooks should be activated or not.
   947         telling if integrity hooks should be activated or not.