avoid logging nil error (#4659)

Co-authored-by: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.co>
This commit is contained in:
Konstantin Lebedev 2023-07-11 11:38:52 +05:00 committed by GitHub
parent 3730772e05
commit 2c076ebd96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,7 +41,9 @@ func (s *RaftServer) HealthzHandler(w http.ResponseWriter, r *http.Request) {
expBackoff.MaxInterval = 1 * time.Second
expBackoff.MaxElapsedTime = 5 * time.Second
isLocked, err := backoff.RetryWithData(s.topo.IsChildLocked, expBackoff)
glog.Errorf("HealthzHandler: %+v", err)
if err != nil {
glog.Errorf("HealthzHandler: %+v", err)
}
if isLocked {
w.WriteHeader(http.StatusLocked)
return