Skip to content
Snippets Groups Projects
Commit b96bd977 authored by Taeho Kim's avatar Taeho Kim Committed by Sheng Yang
Browse files

Fix time.Tick leak

parent 506b0df3
No related branches found
No related tags found
No related merge requests found
......@@ -119,9 +119,11 @@ func (p *LocalPathProvisioner) refreshConfig() error {
func (p *LocalPathProvisioner) watchAndRefreshConfig() {
go func() {
ticker := time.NewTicker(ConfigFileCheckInterval)
defer ticker.Stop()
for {
select {
case <-time.Tick(ConfigFileCheckInterval):
case <-ticker.C:
if err := p.refreshConfig(); err != nil {
logrus.Errorf("failed to load the new config file: %v", err)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment