Skip to content

Commit

Permalink
vtorc: use REPLACE INTO in node_health table update
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Feb 23, 2025
1 parent 413b953 commit 5cf33b4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions go/vt/vtorc/process/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ var ThisNodeHealth = &NodeHealth{}

// writeHealthToDatabase writes to the database and returns if it was successful.
func writeHealthToDatabase() bool {
_, err := db.ExecVTOrc("DELETE FROM node_health")
if err != nil {
log.Error(err)
return false
}
sqlResult, err := db.ExecVTOrc(`INSERT
sqlResult, err := db.ExecVTOrc(`REPLACE
INTO node_health (
last_seen_active
) VALUES (
Expand Down

0 comments on commit 5cf33b4

Please sign in to comment.