Skip to content

Commit

Permalink
bugfix: Agent没有开启监控会无限打日志 #11274
Browse files Browse the repository at this point in the history
  • Loading branch information
tangruotian committed Dec 2, 2024
1 parent a68a9b8 commit 917d590
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/agent/agent/src/pkg/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ const (

func Collect() {
logs.Debug("do Collect")
if config.GAgentConfig.CollectorOn == false {
logs.Info("agent collector off")
return
}

ipChan := config.EBus.Subscribe(config.IpEvent, eBusId, 1)

defer func() {
Expand All @@ -79,11 +84,6 @@ func Collect() {
}

func doAgentCollect(ctx context.Context) {
if config.GAgentConfig.CollectorOn == false {
logs.Info("agent collector off")
return
}

configContent, err := genTelegrafConfig()
if err != nil {
logs.WithError(err).Error("genTelegrafConfig error")
Expand Down

0 comments on commit 917d590

Please sign in to comment.