server/repository.py
changeset 1160 77bf88f01fcc
parent 594 76218d42d21f
child 1187 450c435d69b9
equal deleted inserted replaced
1159:16a426d214ae 1160:77bf88f01fcc
   209         # close initialization pool and reopen fresh ones for proper
   209         # close initialization pool and reopen fresh ones for proper
   210         # initialization now that we know cubes
   210         # initialization now that we know cubes
   211         self._get_pool().close(True) 
   211         self._get_pool().close(True) 
   212         for i in xrange(config['connections-pool-size']):
   212         for i in xrange(config['connections-pool-size']):
   213             self._available_pools.put_nowait(ConnectionsPool(self.sources))
   213             self._available_pools.put_nowait(ConnectionsPool(self.sources))
   214      
   214         self.do_fti = config['delay-full-text-indexation']
       
   215         
   215     # internals ###############################################################
   216     # internals ###############################################################
   216 
   217 
   217     def get_source(self, uri, source_config):
   218     def get_source(self, uri, source_config):
   218         source_config['uri'] = uri
   219         source_config['uri'] = uri
   219         return get_source(source_config, self.schema, self)
   220         return get_source(source_config, self.schema, self)
   827         self.system_source.add_info(session, entity, source, extid)
   828         self.system_source.add_info(session, entity, source, extid)
   828         if complete:
   829         if complete:
   829             entity.complete(entity.e_schema.indexable_attributes())
   830             entity.complete(entity.e_schema.indexable_attributes())
   830         session.add_query_data('neweids', entity.eid)
   831         session.add_query_data('neweids', entity.eid)
   831         # now we can update the full text index
   832         # now we can update the full text index
   832         FTIndexEntityOp(session, entity=entity)
   833         if self.do_fti:
       
   834             FTIndexEntityOp(session, entity=entity)
   833         CleanupEidTypeCacheOp(session)
   835         CleanupEidTypeCacheOp(session)
   834         
   836         
   835     def delete_info(self, session, eid):
   837     def delete_info(self, session, eid):
   836         self._prepare_delete_info(session, eid)
   838         self._prepare_delete_info(session, eid)
   837         self._delete_info(session, eid)
   839         self._delete_info(session, eid)
   993             if not only_inline_rels:
   995             if not only_inline_rels:
   994                 self.hm.call_hooks('before_update_entity', etype, session,
   996                 self.hm.call_hooks('before_update_entity', etype, session,
   995                                     entity)
   997                                     entity)
   996         source.update_entity(session, entity)
   998         source.update_entity(session, entity)
   997         if not only_inline_rels:
   999         if not only_inline_rels:
   998             if need_fti_update:
  1000             if need_fti_update and self.do_fti:
   999                 # reindex the entity only if this query is updating at least
  1001                 # reindex the entity only if this query is updating at least
  1000                 # one indexable attribute
  1002                 # one indexable attribute
  1001                 FTIndexEntityOp(session, entity=entity)
  1003                 FTIndexEntityOp(session, entity=entity)
  1002             if source.should_call_hooks:
  1004             if source.should_call_hooks:
  1003                 self.hm.call_hooks('after_update_entity', etype, session,
  1005                 self.hm.call_hooks('after_update_entity', etype, session,