Fix fsnotify.Remove logic function.

Signed-off-by: zhanluxianshen <zhanluxianshen@163.com>
This commit is contained in:
zhanluxianshen 2024-11-08 22:07:21 +08:00
parent 832818084d
commit f77a808105
No known key found for this signature in database
GPG Key ID: BEBCFB39E2C75D73

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)
}