avoid close closed channel

This commit is contained in:
Chris Lu
2020-10-20 22:54:34 -07:00
parent 20442dc1bc
commit ad652ffb97

View File

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