feat(kv): persist cache and session into disk before shutdown
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/wopi"
|
||||
"github.com/gin-gonic/gin"
|
||||
"io/fs"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// Init 初始化启动
|
||||
@@ -60,6 +61,12 @@ func Init(path string, statics fs.FS) {
|
||||
model.Init()
|
||||
},
|
||||
},
|
||||
{
|
||||
"both",
|
||||
func() {
|
||||
cache.Restore(filepath.Join(model.GetSettingByName("temp_path"), cache.DefaultCacheFile))
|
||||
},
|
||||
},
|
||||
{
|
||||
"both",
|
||||
func() {
|
||||
|
||||
Reference in New Issue
Block a user