未验证 提交 57adb949 编写于 作者: H huanggze

fix: exported logs are incomplete

Signed-off-by: Nhuanggze <loganhuang@yunify.com>
上级 57551318
......@@ -295,15 +295,14 @@ func (es *Elasticsearch) ExportLogs(sf logging.SearchFilter, w io.Writer) error
for _, hit := range res.AllHits {
data = append(data, hit.Log)
}
if len(data) == 0 {
return nil
}
// limit to retrieve max 100k records
for i := 0; i < 100; i++ {
data, id, err = es.scroll(id)
if err != nil {
return err
if i != 0 {
data, id, err = es.scroll(id)
if err != nil {
return err
}
}
if len(data) == 0 {
return nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册