Conversation
|
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.



This pull request introduces a robust "silent mode" feature to the Switcher client, allowing the client to gracefully handle remote API failures by temporarily switching to local snapshot evaluation and retrying remote calls after a configurable interval. The implementation includes new retry logic, enhancements to context and authentication handling, and comprehensive tests for the silent mode and date utilities.
Silent mode and retry logic:
ContextOptionsand integrated it into client initialization, enabling automatic fallback to local evaluation and retrying remote API calls after a specified interval. (switcher_client/client.py,switcher_client/lib/globals/global_context.py, [1] [2]RetryOptionsclass and integrated silent mode retry logic inRemoteAuth, including token expiration and renewal handling. (switcher_client/lib/globals/global_retry.py,switcher_client/lib/remote_auth.py, [1] [2] [3] [4]switcher_client/lib/remote.py, switcher_client/lib/remote.pyR32-R38)Utility and error handling improvements:
DateMomentutility class for flexible date/time manipulation, used for calculating retry intervals in silent mode. (switcher_client/lib/utils/date_moment.py, switcher_client/lib/utils/date_moment.pyR1-R26)switcher_client/switcher.py, switcher_client/switcher.pyR40-R51)Testing and documentation:
DateMomentutility. (tests/test_switcher_silent_mode.py,tests/utils/test_date_moment.py, [1] [2]README.md, README.mdL135-R135)