Skip to content

Commit

Permalink
refactor: empty query handler is not an issue anymore (#1844)
Browse files Browse the repository at this point in the history
* refactor: empty query handler is not an issue anymore

* fix: empty query handler
  • Loading branch information
florian-hoenicke committed Feb 4, 2021
1 parent df3e99a commit 4dbf094
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion jina/executors/indexers/__init__.py
Expand Up @@ -113,7 +113,7 @@ def query_handler(self):
:attr:`query_handler` and :attr:`write_handler` are by default mutex
"""
r = None
if (not self.handler_mutex or not self.is_handler_loaded) and self.is_exist:
if not self.handler_mutex or not self.is_handler_loaded:
r = self.get_query_handler()
if r is None:
self.logger.warning(f'you can not query from {self} as its "query_handler" is not set. '
Expand Down
4 changes: 0 additions & 4 deletions jina/executors/indexers/cache.py
Expand Up @@ -88,10 +88,6 @@ def query(self, data, *args, **kwargs) -> Optional[bool]:
:param data: either the id or the content_hash of a Document
:return: status
"""
# FIXME this shouldn't happen
if self.query_handler is None:
self.query_handler = self.get_query_handler()

if self.field == ID_KEY:
status = (data in self.query_handler.ids) or None
else:
Expand Down

0 comments on commit 4dbf094

Please sign in to comment.