Skip to content

Commit 77da2a1

Browse files
committed
fix tests
1 parent a233e30 commit 77da2a1

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

worker.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,15 @@ func initWorkers(opt []workerOpt) (watchPatterns []*watcher.PatternGroup, _ erro
9696
startupFailChan = nil
9797
}
9898

99-
watchPatterns = append(watchPatterns, &watcher.PatternGroup{
100-
Callback: func(_ []*watcher.Event) {
101-
if restartWorkers.Swap(false) {
102-
RestartWorkers()
103-
}
104-
},
105-
})
99+
if watcherIsEnabled {
100+
watchPatterns = append(watchPatterns, &watcher.PatternGroup{
101+
Callback: func(_ []*watcher.Event) {
102+
if restartWorkers.Swap(false) {
103+
RestartWorkers()
104+
}
105+
},
106+
})
107+
}
106108

107109
return watchPatterns, nil
108110
}

0 commit comments

Comments
 (0)