Skip to content

Commit

Permalink
make save on set only when err is nil (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlucus authored Jul 2, 2024
1 parent a610784 commit 7631184
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gnmi_server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,10 @@ func (s *Server) Set(ctx context.Context, req *gnmipb.SetRequest) (*gnmipb.SetRe
err = dc.Set(req.GetDelete(), req.GetReplace(), req.GetUpdate())
if err != nil {
common_utils.IncCounter(common_utils.GNMI_SET_FAIL)
} else {
s.SaveStartupConfig()
}

s.SaveStartupConfig()
return &gnmipb.SetResponse{
Prefix: req.GetPrefix(),
Response: results,
Expand Down

0 comments on commit 7631184

Please sign in to comment.