fix(cli): add configurable context.WithTimeout to all CLI handler functions#76
Merged
Conversation
…ctions - Add DefaultTimeout (30s), UploadTimeout (300s), SyncTimeout (60s) to config - Add accessor methods with fallback defaults: GetDefaultTimeout(), GetUploadTimeout(), GetSyncTimeout() - Add context.WithTimeout to ~52 handler functions across 20 files - Watch loops use original ctx (no timeout) via setupCtx pattern - Sync/profiling handlers use GetSyncTimeout(), upload/bench use GetUploadTimeout() - Update test mocks with cfgMgr.EXPECT().Config().Return().Maybe() - admin_quota.go and ipns.go unchanged (already had hardcoded timeouts)
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Coverage ReportTotal Coverage: 53.5% Generated from commit: 9221dce |
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.
Add configurable context timeouts to all CLI handler functions. Three new timeout settings are introduced in the config (
default_timeout,upload_timeout,sync_timeout) with sensible defaults (30s, 5m, 1m respectively), and each CLI action now applies the appropriatecontext.WithTimeoutbefore making API calls. Upload/download/benchmark operations use the upload timeout, sync/cleanup/reconciliation operations use the sync timeout, and all other operations use the default timeout. Tests were updated to usemock.Anythingfor context arguments and to mock the newConfig()calls needed for timeout resolution.