feat: concurrent pagination, resilience improvements, and execution summary#171
Open
huohua-dev wants to merge 9 commits intolc:masterfrom
Open
feat: concurrent pagination, resilience improvements, and execution summary#171huohua-dev wants to merge 9 commits intolc:masterfrom
huohua-dev wants to merge 9 commits intolc:masterfrom
Conversation
added 9 commits
March 14, 2026 19:09
- Call os.Stdout.Sync() after each URL write in WriteURLs and WriteURLsJSON - Ensure data is immediately flushed to disk in pipe/redirect scenarios - Add atomic URL counter parameter for exit summary tracking
- Add StatusCodeError type to carry HTTP status codes through error chain - Implement exponential backoff retry for network errors (capped at 30s) - Skip retry for 429 rate-limit and 400 bad-request responses - Add shouldRetry() to detect retryable network errors - Replace manual case-insensitive search with strings.ToLower
- Implement dispatcher+worker pattern for parallel page fetching - Use sync.Once to safely stop dispatcher on empty results - Add structured logging with provider/domain/page fields - Use StatusCodeError for proper 400 status handling - Support configurable provider-threads parameter
- Implement dispatcher+worker pattern for parallel page fetching - Use errors.As with StatusCodeError for proper 429 detection - Stop pagination when has_next is false - Add structured logging with provider/domain/page/status fields
…rawl - Implement dispatcher+worker pattern using known page count - Cap worker threads to actual page count - Use errors.As with StatusCodeError for proper error classification - Add structured logging for connection errors and API errors
- Add provider/domain/page/error fields to warning logs - Add response body to rate-limit log for debugging
- Add ProviderThreads field to providers.Config - Register --provider-threads CLI flag with default value 3 - Support provider-threads in .gau.toml config file
- Create timeout context for each provider work item - Cap provider timeout at 5 minutes to prevent single provider blocking - Add structured logging with provider/domain/timeout fields
- Track total URL count using atomic counter - Log summary with total URLs and duration on exit
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.
Features & Improvements
Split from #169 as requested — this PR contains only the feature enhancements.
Changes
StatusCodeErrortype and automatic retry logic for transient failures--provider-threadsflag — controls per-provider concurrent pagination goroutinesMotivation
These changes significantly improve gau's performance and reliability: