feat(routing): choose quota window for earlier reset#643
Closed
wuchao05 wants to merge 2 commits into
Closed
Conversation
Author
|
Superseded by #644 so the source branch follows the repository's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a configurable reset window for the existing "Prefer earlier reset" routing behavior. Operators can now choose whether earlier-reset routing is driven by the primary 5-hour quota window or the secondary weekly quota window.
Why
The previous implementation always prioritized the secondary reset window. That made the setting less useful for traffic shaping when the primary 5-hour quota is the tighter operational constraint.
Changes
prefer_earlier_reset_windowin dashboard settings with a migration and API/schema support.5h quotavsWeekly quotaand update the status bar label.Validation
.venv/bin/pytest tests/unit/test_load_balancer.py tests/integration/test_settings_api.py -qPATH="/opt/homebrew/bin:$PATH" ./node_modules/.bin/vitest run src/features/settings/schemas.test.ts src/features/settings/components/routing-settings.test.tsx src/features/settings/hooks/use-settings.test.ts src/features/settings/components/totp-settings.test.tsx src/features/settings/components/session-settings.test.tsxPATH="/opt/homebrew/bin:$PATH" ./node_modules/.bin/tsc -b.venv/bin/python -m app.db.migrate check