优化代码

This commit is contained in:
刘祥超
2022-09-23 09:28:19 +08:00
parent c568ad3e9a
commit 5655f89ba6
20 changed files with 90 additions and 58 deletions

View File

@@ -86,7 +86,7 @@ func (this *HealthCheckTask) Loop() error {
// 检查是否有变化
newJSON, _ := json.Marshal(config)
oldJSON, _ := json.Marshal(task.Config())
if bytes.Compare(oldJSON, newJSON) != 0 {
if !bytes.Equal(oldJSON, newJSON) {
remotelogs.Println("TASK", "[HealthCheckTask]update cluster '"+numberutils.FormatInt64(clusterId)+"'")
goman.New(func() {
task.Reset(config)