File tree 1 file changed +5
-1
lines changed
plugins/inputs/prometheus
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 9
9
"os"
10
10
"path/filepath"
11
11
"strings"
12
+ "sync"
12
13
"time"
13
14
14
15
"github.com/go-kit/log"
@@ -42,6 +43,7 @@ type TargetAllocatorManager struct {
42
43
enabled bool
43
44
host component.Host
44
45
shutdownCh chan struct {}
46
+ shutdownOnce sync.Once
45
47
taReadyCh chan struct {}
46
48
reloadConfigHandler func (config * promconfig.Config )
47
49
manager * tamanager.Manager
@@ -177,7 +179,9 @@ func (tam *TargetAllocatorManager) Run() error {
177
179
}
178
180
func (tam * TargetAllocatorManager ) Shutdown () {
179
181
tam .manager .Shutdown ()
180
- close (tam .shutdownCh )
182
+ tam .shutdownOnce .Do (func () {
183
+ close (tam .shutdownCh )
184
+ })
181
185
}
182
186
func (tam * TargetAllocatorManager ) AttachReloadConfigHandler (handler func (config * promconfig.Config )) {
183
187
tam .reloadConfigHandler = handler
You can’t perform that action at this time.
0 commit comments