Skip to content

Commit

Permalink
fix: redis 慢日志进度文件更新报错问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
jayjiahua committed Jun 15, 2023
1 parent 592a3bf commit b345ef2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions filebeat/input/redis/harvester.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/elastic/beats/libbeat/logp"

"github.com/elastic/beats/filebeat/harvester"
"github.com/elastic/beats/filebeat/input/file"
"github.com/elastic/beats/filebeat/util"
)

Expand Down Expand Up @@ -162,6 +163,12 @@ func (h *Harvester) Run() error {
},
}

// 设置为完成状态,避免进度文件回写报错
data.SetState(file.State{
Type: "redis",
Finished: true,
})

h.forwarder.Send(data)
}
return nil
Expand All @@ -176,3 +183,4 @@ func (h *Harvester) Stop() {
func (h *Harvester) ID() uuid.UUID {
return h.id
}

0 comments on commit b345ef2

Please sign in to comment.