feat(kv): persist cache and session into disk before shutdown

This commit is contained in:
Aaron Liu
2023-04-16 09:17:06 +08:00
parent 4d131db504
commit b9d9e036c9
12 changed files with 347 additions and 57 deletions

View File

@@ -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() {