-
Couldn't load subscription status.
- Fork 56
Add bypass #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bypass #176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds an environment-driven bypass mode to the HTTP API, allowing throttle checks to be skipped when FRENO_BYPASS_ENABLED is set.
- Introduces
bypassEnabledfield onAPIImpland reads it fromFRENO_BYPASS_ENABLED. - Short-circuits
checkhandler to always return HTTP 200 when bypass is enabled.
Comments suppressed due to low confidence (2)
pkg/http/api.go:65
- Add a comment above this field explaining that when true, throttle checks are bypassed to clarify its purpose in the API behavior.
bypassEnabled bool
pkg/http/api.go:171
- Add unit tests for the bypass path to verify that throttle checks are correctly short-circuited and return HTTP 200 when bypass is enabled.
if api.bypassEnabled {
Co-authored-by: Copilot <[email protected]>
This reverts commit 8dd637c.
pkg/throttle/throttler.go
Outdated
| } | ||
| if len(totalHosts) == 0 { | ||
| if throttler.BypassOnNoHostsFound { | ||
| log.Debugf("No hosts for pool: %+v, but bypass is enabled", poolName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we get a stat counter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metrics.GetOrRegisterCounter("<name>", nil).Inc(1)
No description provided.