Skip to content

Commit

Permalink
bugfix: update cluster when heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed Oct 2, 2022
1 parent 562f98d commit e70622d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/models/alerting_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e70622d

Please sign in to comment.