mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-24 15:30:24 +08:00
WebP策略变化时只更新相关配置
This commit is contained in:
@@ -1043,7 +1043,7 @@ func (this *NodeClusterDAO) UpdateClusterWebPPolicy(tx *dbs.Tx, clusterId int64,
|
||||
return err
|
||||
}
|
||||
|
||||
return this.NotifyUpdate(tx, clusterId)
|
||||
return this.NotifyWebPPolicyUpdate(tx, clusterId)
|
||||
}
|
||||
|
||||
webpPolicyJSON, err := json.Marshal(webpPolicy)
|
||||
@@ -1058,7 +1058,7 @@ func (this *NodeClusterDAO) UpdateClusterWebPPolicy(tx *dbs.Tx, clusterId int64,
|
||||
return err
|
||||
}
|
||||
|
||||
return this.NotifyUpdate(tx, clusterId)
|
||||
return this.NotifyWebPPolicyUpdate(tx, clusterId)
|
||||
}
|
||||
|
||||
// FindClusterWebPPolicy 查询WebP设置
|
||||
@@ -1083,7 +1083,7 @@ func (this *NodeClusterDAO) FindClusterWebPPolicy(tx *dbs.Tx, clusterId int64, c
|
||||
return nodeconfigs.DefaultWebPImagePolicy, nil
|
||||
}
|
||||
|
||||
var policy = &nodeconfigs.WebPImagePolicy{}
|
||||
var policy = nodeconfigs.NewWebPImagePolicy()
|
||||
err = json.Unmarshal(webpJSON, policy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1518,6 +1518,11 @@ func (this *NodeClusterDAO) NotifyTOAUpdate(tx *dbs.Tx, clusterId int64) error {
|
||||
return SharedNodeTaskDAO.CreateClusterTask(tx, nodeconfigs.NodeRoleNode, clusterId, 0, 0, NodeTaskTypeTOAChanged)
|
||||
}
|
||||
|
||||
// NotifyWebPPolicyUpdate 通知WebP策略更新
|
||||
func (this *NodeClusterDAO) NotifyWebPPolicyUpdate(tx *dbs.Tx, clusterId int64) error {
|
||||
return SharedNodeTaskDAO.CreateClusterTask(tx, nodeconfigs.NodeRoleNode, clusterId, 0, 0, NodeTaskTypeWebPPolicyChanged)
|
||||
}
|
||||
|
||||
// NotifyDNSUpdate 通知DNS更新
|
||||
// TODO 更新新的DNS解析记录的同时,需要删除老的DNS解析记录
|
||||
func (this *NodeClusterDAO) NotifyDNSUpdate(tx *dbs.Tx, clusterId int64) error {
|
||||
|
||||
Reference in New Issue
Block a user