Browse Source

fix: 修复es存储失效时,会话命令列表页面报错的问题

pull/8922/head
Jiangjie.Bai 2 years ago
parent
commit
65269db849
  1. 8
      apps/terminal/backends/command/es.py

8
apps/terminal/backends/command/es.py

@ -169,6 +169,14 @@ class CommandStore(object):
return self.es.index(index=self.index, doc_type=self.doc_type, body=data)
def filter(self, query: dict, from_=None, size=None, sort=None):
try:
data = self._filter(query, from_, size, sort)
except Exception as e:
logger.error('ES filter error: {}'.format(e))
data = []
return data
def _filter(self, query: dict, from_=None, size=None, sort=None):
body = self.get_query_body(**query)
data = self.es.search(

Loading…
Cancel
Save