Skip to content

Commit

Permalink
Update version selector
Browse files Browse the repository at this point in the history
  • Loading branch information
alpinskiy committed Nov 27, 2024
1 parent 75d010d commit a09751c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3364,16 +3364,14 @@ func pprofAccessAllowed(h *httpRequestHandler) bool {

func (h *requestHandler) init(accessToken, version string) (err error) {
switch version {
case Version1:
h.version = Version1
case Version2:
case Version1, Version3:
h.version = version
case Version2, "":
if rand.Float64() < h.Handler.Version3Prob.Load() {
h.version = Version3
} else {
h.version = Version2
}
case Version3, "":
h.version = Version3
default:
return fmt.Errorf("invalid version: %q", version)
}
Expand Down

0 comments on commit a09751c

Please sign in to comment.