Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 支持主配置变更重加载 #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yiqiwang-17
Copy link
Collaborator

No description provided.

"fmt"
"github.com/TencentBlueKing/bkunifylogbeat/utils"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意代码格式化。

@@ -118,6 +123,7 @@ func (bt *LogBeat) Run() error {
}

reloadTicker := time.NewTicker(10 * time.Second)
diffTaskTicker := time.NewTicker(60 * time.Second)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 ticker 也需要 defer stop

@@ -130,6 +136,11 @@ func (bt *LogBeat) Run() error {
bt.Reload(config)
}
}
// 处理采集器主配置是否变更,变更则发送重加载信号
case <-diffTaskTicker.C:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议按需开启,而不是成为一种默认行为。

if err != nil {
return err
}
if !rawConfig.HasField("bkunifylogbeat") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个建议可以写成常量。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants