bugfix: update cluster when heartbeat

This commit is contained in:
Ulric Qin 2022-10-02 21:21:17 +08:00
parent 562f98ddaf
commit e70622d18c
1 changed files with 3 additions and 2 deletions

View File

@ -87,8 +87,9 @@ func AlertingEngineHeartbeat(instance, cluster string) error {
Clock: time.Now().Unix(),
}).Error
} else {
// update
err = DB().Model(new(AlertingEngines)).Where("instance=?", instance).Update("clock", time.Now().Unix()).Error
// updates
fields := map[string]interface{}{"clock": time.Now().Unix(), "cluster": cluster}
err = DB().Model(new(AlertingEngines)).Where("instance=?", instance).Updates(fields).Error
}
return err