优化缓存任务Key状态增加执行中状态

This commit is contained in:
刘祥超
2022-06-15 15:18:18 +08:00
parent b87e48c1f9
commit d59f80b3ec
2 changed files with 21 additions and 0 deletions

View File

@@ -1 +1,20 @@
package models
import "encoding/json"
// DecodeNodes 解析已完成节点信息
func (this *HTTPCacheTaskKey) DecodeNodes() map[string]bool {
var result = map[string]bool{}
var nodesJSON = this.Nodes
if IsNull(nodesJSON) {
return result
}
err := json.Unmarshal(nodesJSON, &result)
if err != nil {
// ignore error
return result
}
return result
}