mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-04 16:00:24 +08:00
边缘节点支持设置多个缓存目录
This commit is contained in:
@@ -2,7 +2,9 @@ package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ddosconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
"sort"
|
||||
@@ -181,3 +183,16 @@ func (this *Node) DecodeLnAddrs() []string {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (this *Node) DecodeCacheDiskSubDirs() []*serverconfigs.CacheDir {
|
||||
if IsNull(this.CacheDiskSubDirs) {
|
||||
return nil
|
||||
}
|
||||
|
||||
var result = []*serverconfigs.CacheDir{}
|
||||
err := json.Unmarshal(this.CacheDiskSubDirs, &result)
|
||||
if err != nil {
|
||||
remotelogs.Error("Node.DecodeCacheDiskSubDirs", err.Error())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user