diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-16 00:39:21 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-16 00:39:21 -0800 |
| commit | 37e8fce8414232885a8071bd931535870be6e2d6 (patch) | |
| tree | 916b62a4d27f782e02c79d1fc09a1ad5d862bc27 | |
| parent | d4dc00471a4390d8f299fbb286fe0b65596712e6 (diff) | |
| download | seaweedfs-37e8fce8414232885a8071bd931535870be6e2d6.tar.xz seaweedfs-37e8fce8414232885a8071bd931535870be6e2d6.zip | |
clean up cache on exit
| -rw-r--r-- | weed/filesys/wfs.go | 1 | ||||
| -rw-r--r-- | weed/mount/weedfs.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index 7ee9a10ea..2a8ecd235 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -125,6 +125,7 @@ func NewSeaweedFileSystem(option *Option) *WFS { }) grace.OnInterrupt(func() { wfs.metaCache.Shutdown() + os.RemoveAll(option.getUniqueCacheDir()) }) wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs, id: 1} diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index d3342a8de..11958c39e 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -99,6 +99,7 @@ func NewSeaweedFileSystem(option *Option) *WFS { }) grace.OnInterrupt(func() { wfs.metaCache.Shutdown() + os.RemoveAll(option.getUniqueCacheDir()) }) if wfs.option.ConcurrentWriters > 0 { |
