mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-17 17:51:20 +08:00
avoid shutdown in the middle of running
This commit is contained in:
@@ -88,9 +88,6 @@ func NewSeaweedFileSystem(option *Option) *WFS {
|
|||||||
if option.CacheSizeMB > 0 {
|
if option.CacheSizeMB > 0 {
|
||||||
os.MkdirAll(cacheDir, 0755)
|
os.MkdirAll(cacheDir, 0755)
|
||||||
wfs.chunkCache = chunk_cache.NewTieredChunkCache(256, cacheDir, option.CacheSizeMB)
|
wfs.chunkCache = chunk_cache.NewTieredChunkCache(256, cacheDir, option.CacheSizeMB)
|
||||||
grace.OnInterrupt(func() {
|
|
||||||
wfs.chunkCache.Shutdown()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wfs.metaCache = meta_cache.NewMetaCache(path.Join(cacheDir, "meta"))
|
wfs.metaCache = meta_cache.NewMetaCache(path.Join(cacheDir, "meta"))
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
|
||||||
"golang.org/x/net/webdav"
|
"golang.org/x/net/webdav"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
@@ -101,9 +100,6 @@ type WebDavFile struct {
|
|||||||
func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) {
|
func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error) {
|
||||||
|
|
||||||
chunkCache := chunk_cache.NewTieredChunkCache(256, option.CacheDir, option.CacheSizeMB)
|
chunkCache := chunk_cache.NewTieredChunkCache(256, option.CacheDir, option.CacheSizeMB)
|
||||||
grace.OnInterrupt(func() {
|
|
||||||
chunkCache.Shutdown()
|
|
||||||
})
|
|
||||||
return &WebDavFileSystem{
|
return &WebDavFileSystem{
|
||||||
option: option,
|
option: option,
|
||||||
chunkCache: chunkCache,
|
chunkCache: chunkCache,
|
||||||
|
|||||||
Reference in New Issue
Block a user