Browse Source

avoid close closed channel

pull/1553/head
Chris Lu 4 years ago
parent
commit
ad652ffb97
  1. 6
      weed/filesys/filehandle.go

6
weed/filesys/filehandle.go

@ -185,8 +185,10 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err
}
// stop the goroutine
fh.dirtyPages.chunkSaveErrChanClosed = true
close(fh.dirtyPages.chunkSaveErrChan)
if !fh.dirtyPages.chunkSaveErrChanClosed {
fh.dirtyPages.chunkSaveErrChanClosed = true
close(fh.dirtyPages.chunkSaveErrChan)
}
return nil
}

Loading…
Cancel
Save