File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -495,9 +495,11 @@ func (w *Watcher) retrieveFileList() map[string]os.FileInfo {
495
495
list , err = w .listRecursive (name )
496
496
if err != nil {
497
497
if os .IsNotExist (err ) {
498
- w .Error <- ErrWatchedFileDeleted
499
498
w .mu .Unlock ()
500
- w .RemoveRecursive (err .(* os.PathError ).Path )
499
+ if name == err .(* os.PathError ).Path {
500
+ w .Error <- ErrWatchedFileDeleted
501
+ w .RemoveRecursive (name )
502
+ }
501
503
w .mu .Lock ()
502
504
} else {
503
505
w .Error <- err
@@ -507,9 +509,11 @@ func (w *Watcher) retrieveFileList() map[string]os.FileInfo {
507
509
list , err = w .list (name )
508
510
if err != nil {
509
511
if os .IsNotExist (err ) {
510
- w .Error <- ErrWatchedFileDeleted
511
512
w .mu .Unlock ()
512
- w .Remove (err .(* os.PathError ).Path )
513
+ if name == err .(* os.PathError ).Path {
514
+ w .Error <- ErrWatchedFileDeleted
515
+ w .Remove (name )
516
+ }
513
517
w .mu .Lock ()
514
518
} else {
515
519
w .Error <- err
You can’t perform that action at this time.
0 commit comments