server/sources/native.py
branchstable
changeset 5061 cdab5220eac0
parent 5059 1d5c81588144
child 5067 adc2122eed03
equal deleted inserted replaced
5060:ee3b856e1406 5061:cdab5220eac0
   189         # full text index helper
   189         # full text index helper
   190         self.do_fti = not repo.config['delay-full-text-indexation']
   190         self.do_fti = not repo.config['delay-full-text-indexation']
   191         # sql queries cache
   191         # sql queries cache
   192         self._cache = Cache(repo.config['rql-cache-size'])
   192         self._cache = Cache(repo.config['rql-cache-size'])
   193         self._temp_table_data = {}
   193         self._temp_table_data = {}
       
   194         # we need a lock to protect eid attribution function (XXX, really?
       
   195         # explain)
   194         self._eid_creation_lock = Lock()
   196         self._eid_creation_lock = Lock()
   195         # (etype, attr) / storage mapping
   197         # (etype, attr) / storage mapping
   196         self._storages = {}
   198         self._storages = {}
   197         # entity types that may be used by other multi-sources instances
   199         # entity types that may be used by other multi-sources instances
   198         self.multisources_etypes = set(repo.config['multi-sources-etypes'])
   200         self.multisources_etypes = set(repo.config['multi-sources-etypes'])
   678             return
   680             return
   679         if extid is not None:
   681         if extid is not None:
   680             assert isinstance(extid, str), type(extid)
   682             assert isinstance(extid, str), type(extid)
   681             extid = b64encode(extid)
   683             extid = b64encode(extid)
   682         attrs = {'type': entity.__regid__, 'eid': entity.eid, 'extid': extid,
   684         attrs = {'type': entity.__regid__, 'eid': entity.eid, 'extid': extid,
   683                  'source': uri, 'dtime': datetime.now(),
   685                  'source': uri, 'dtime': datetime.now()}
   684                  }
       
   685         self.doexec(session, self.sqlgen.insert('deleted_entities', attrs), attrs)
   686         self.doexec(session, self.sqlgen.insert('deleted_entities', attrs), attrs)
   686 
   687 
   687     def modified_entities(self, session, etypes, mtime):
   688     def modified_entities(self, session, etypes, mtime):
   688         """return a 2-uple:
   689         """return a 2-uple:
   689         * list of (etype, eid) of entities of the given types which have been
   690         * list of (etype, eid) of entities of the given types which have been