Skip to content

Commit 6c711a0

Browse files
committed
poll before fsWatcher is non-nil
1 parent 1dcaec4 commit 6c711a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcalico-go/lib/epstatusfile/status_file_watcher.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ func (w *FileWatcher) runWatcher() {
164164
log.WithError(err).Info("Error initializing fsnotify. Falling back to polling.")
165165
}
166166

167+
w.scanDirectory()
167168
if w.fsWatcher != nil {
168169
// Get current state of the directory and emit initial events.
169170
w.fsnotifyActive = true
170-
w.scanDirectory()
171171
// Run fsnotify watcher loop if possible.
172172
err := w.runFsnotifyWatcher(w.fsWatcher)
173173
w.fsnotifyActive = false

0 commit comments

Comments
 (0)