Merge pull request from zhanluxianshen/fix-fsnotify-logic

Fix fsnotify.Remove logic function.
This commit is contained in:
Evan Lezar 2024-11-29 14:17:03 +01:00 committed by GitHub
commit 21ba9932d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -187,11 +187,11 @@ create:
if !strings.HasPrefix(deviceNode, "nvidia") {
continue
}
if event.Op&fsnotify.Create == fsnotify.Create {
if event.Has(fsnotify.Create) {
m.logger.Infof("%s created, restarting.", event.Name)
goto create
}
if event.Op&fsnotify.Create == fsnotify.Remove {
if event.Has(fsnotify.Remove) {
m.logger.Infof("%s removed. Ignoring", event.Name)
}