Skip to content

Commit

Permalink
fix(go.d): clean up charts for stopped and removed jobs (netdata#19573)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Feb 4, 2025
1 parent dd7861a commit 9b3d9f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/go/plugin/go.d/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func serve(a *Agent) {
var exit bool

for {
module.ObsoleteCharts(false)
module.ObsoleteCharts(true)

ctx, cancel := context.WithCancel(context.Background())

Expand All @@ -116,7 +116,6 @@ func serve(a *Agent) {
switch sig {
case syscall.SIGHUP:
a.Infof("received %s signal (%d). Restarting running instance", sig, sig)
module.ObsoleteCharts(true)
default:
a.Infof("received %s signal (%d). Terminating...", sig, sig)
exit = true
Expand All @@ -126,6 +125,10 @@ func serve(a *Agent) {
exit = true
}

if exit {
module.ObsoleteCharts(false)
}

cancel()

func() {
Expand Down

0 comments on commit 9b3d9f3

Please sign in to comment.