server/repository.py
changeset 9449 287a05ec7ab1
parent 9448 3e7cad3967c5
child 9450 af4b93bc38a5
equal deleted inserted replaced
9448:3e7cad3967c5 9449:287a05ec7ab1
   880         session = self._get_session(sessionid, setcnxset=True, txid=txid)
   880         session = self._get_session(sessionid, setcnxset=True, txid=txid)
   881         try:
   881         try:
   882             return self.system_source.undo_transaction(session, txuuid)
   882             return self.system_source.undo_transaction(session, txuuid)
   883         finally:
   883         finally:
   884             session.free_cnxset()
   884             session.free_cnxset()
   885 
       
   886     # public (inter-repository) interface #####################################
       
   887 
       
   888     def entities_modified_since(self, etypes, mtime):
       
   889         """function designed to be called from an external repository which
       
   890         is using this one as a rql source for synchronization, and return a
       
   891         3-uple containing :
       
   892         * the local date
       
   893         * list of (etype, eid) of entities of the given types which have been
       
   894           modified since the given timestamp (actually entities whose full text
       
   895           index content has changed)
       
   896         * list of (etype, eid) of entities of the given types which have been
       
   897           deleted since the given timestamp
       
   898         """
       
   899         with self.internal_session() as session:
       
   900             updatetime = datetime.utcnow()
       
   901             modentities, delentities = self.system_source.modified_entities(
       
   902                 session, etypes, mtime)
       
   903             return updatetime, modentities, delentities
       
   904 
   885 
   905     # session handling ########################################################
   886     # session handling ########################################################
   906 
   887 
   907     def close_sessions(self):
   888     def close_sessions(self):
   908         """close every opened sessions"""
   889         """close every opened sessions"""