From 77f1af988aa452aec303b1f7c171dae72abe1131 Mon Sep 17 00:00:00 2001 From: secwall Date: Tue, 11 Jun 2024 16:47:52 +0200 Subject: [PATCH] Do not try to create and then set node in dcs (Set already handles this) (#109) --- internal/app/app_dcs.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/internal/app/app_dcs.go b/internal/app/app_dcs.go index 291c9fc2..df8c07e8 100644 --- a/internal/app/app_dcs.go +++ b/internal/app/app_dcs.go @@ -95,10 +95,6 @@ func (app *App) setResetupStatus(host string, status bool) error { Status: status, UpdateTime: time.Now(), } - err = app.dcs.Create(dcs.JoinPath(pathResetupStatus, host), resetupStatus) - if err != nil && err != dcs.ErrExists { - return err - } err = app.dcs.Set(dcs.JoinPath(pathResetupStatus, host), resetupStatus) if err != nil { return err @@ -113,11 +109,7 @@ func (app *App) GetResetupStatus(host string) (mysql.ResetupStatus, error) { } func (app *App) UpdateLastShutdownNodeTime() error { - err := app.dcs.Create(pathLastShutdownNodeTime, time.Now()) - if err != nil && err != dcs.ErrExists { - return err - } - err = app.dcs.Set(pathLastShutdownNodeTime, time.Now()) + err := app.dcs.Set(pathLastShutdownNodeTime, time.Now()) if err != nil { return err }