server/sources/pyrorql.py
branchstable
changeset 4816 c02583cb80a9
parent 4212 ab6573088b4a
child 4913 083b4d454192
equal deleted inserted replaced
4815:4ee224c4c41d 4816:c02583cb80a9
   180         updatetime, modified, deleted = extrepo.entities_modified_since(etypes,
   180         updatetime, modified, deleted = extrepo.entities_modified_since(etypes,
   181                                                                         mtime)
   181                                                                         mtime)
   182         self._query_cache.clear()
   182         self._query_cache.clear()
   183         repo = self.repo
   183         repo = self.repo
   184         session = repo.internal_session()
   184         session = repo.internal_session()
       
   185         source = repo.system_source
   185         try:
   186         try:
   186             for etype, extid in modified:
   187             for etype, extid in modified:
   187                 try:
   188                 try:
   188                     exturi = cnx.describe(extid)[1]
   189                     exturi = cnx.describe(extid)[1]
   189                     if exturi == 'system' or not exturi in repo.sources_by_uri:
   190                     if exturi == 'system' or not exturi in repo.sources_by_uri:
   190                         eid = self.extid2eid(str(extid), etype, session)
   191                         eid = self.extid2eid(str(extid), etype, session)
   191                         rset = session.eid_rset(eid, etype)
   192                         rset = session.eid_rset(eid, etype)
   192                         entity = rset.get_entity(0, 0)
   193                         entity = rset.get_entity(0, 0)
   193                         entity.complete(entity.e_schema.indexable_attributes())
   194                         entity.complete(entity.e_schema.indexable_attributes())
   194                         repo.index_entity(session, entity)
   195                         source.index_entity(session, entity)
   195                 except:
   196                 except:
   196                     self.exception('while updating %s with external id %s of source %s',
   197                     self.exception('while updating %s with external id %s of source %s',
   197                                    etype, extid, self.uri)
   198                                    etype, extid, self.uri)
   198                     continue
   199                     continue
   199             for etype, extid in deleted:
   200             for etype, extid in deleted: