Skip to content

Commit

Permalink
Do not try to create and then set node in dcs (Set already handles this)
Browse files Browse the repository at this point in the history
  • Loading branch information
secwall committed Jun 11, 2024
1 parent bc9b606 commit 051deb8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/app/app_dcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 051deb8

Please sign in to comment.