Skip to content

Commit

Permalink
simplify the code of querying parameter serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrtr committed Nov 14, 2021
1 parent fc0129c commit 754cce1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions server/etcdserver/api/etcdhttp/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,7 @@ func getExcludedAlarms(r *http.Request) (alarms AlarmSet) {
}

func getSerializableFlag(r *http.Request) bool {
serializable, found := r.URL.Query()["serializable"]
if found {
if len(serializable) == 1 && serializable[0] == "true" {
return true
}
}
return false
return r.URL.Query().Get("serializable") == "true"
}

// TODO: etcdserver.ErrNoLeader in health API
Expand Down

0 comments on commit 754cce1

Please sign in to comment.