feat(download): make retry count configurable via --retries flag #145

Merged
fuzzy merged 2 commits from feat/retry-backoff into main 2026-07-13 18:24:35 +00:00
Owner

What

Make retry count configurable via --retries/-r flag and PGET_RETRIES env var. Backoff already implemented as exponential (1s, 2s, 4s...).

Why

Allows users to tune retry behavior. Default 3, min 0 (no retries).

Testing

  • go vet ./... passes
  • go build ./... passes
  • golangci-lint run ./... passes
  • Pre-commit hooks pass

Breaking Changes

Download() signature changed — added maxRetries int parameter.
Hardcoded maxRetries constant removed — value now flows from config through download.

Notes

  • Config.MaxRetries added, --retries flag, PGET_RETRIES env var
  • Validation: retries >= 0
  • runWorker receives maxRetries parameter instead of using package constant
  • Exponential backoff pattern: 1s, 2s, 4s, 8s...
  • Abort after maxRetries attempts per chunk

Closes #0056
Closes #0057
Closes #0058
Closes #0059

## What Make retry count configurable via `--retries`/`-r` flag and `PGET_RETRIES` env var. Backoff already implemented as exponential (1s, 2s, 4s...). ## Why Allows users to tune retry behavior. Default 3, min 0 (no retries). ## Testing - [x] `go vet ./...` passes - [x] `go build ./...` passes - [x] `golangci-lint run ./...` passes - [x] Pre-commit hooks pass ## Breaking Changes `Download()` signature changed — added `maxRetries int` parameter. Hardcoded `maxRetries` constant removed — value now flows from config through download. ## Notes - `Config.MaxRetries` added, `--retries` flag, `PGET_RETRIES` env var - Validation: retries >= 0 - `runWorker` receives `maxRetries` parameter instead of using package constant - Exponential backoff pattern: 1s, 2s, 4s, 8s... - Abort after maxRetries attempts per chunk Closes #0056 Closes #0057 Closes #0058 Closes #0059
Closes #0056 Closes #0057 Closes #0058 Closes #0059
docs(roadmap): mark retry and backoff complete
All checks were successful
Test and Release / test (pull_request) Successful in 2m43s
Test and Release / lint (pull_request) Successful in 4m17s
24214cd9a9
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-13 18:20:19 +00:00
the.auditor left a comment

Review: APPROVED

Verification

  • go vet ./... passes
  • go build ./... passes
  • golangci-lint v2 run ./... 0 issues

Changes

  • internal/config/config.go — adds MaxRetries, --retries/-r flag, PGET_RETRIES env var, validation
  • internal/downloader/download.go — removes hardcoded maxRetries constant, parameter flows from config through Download() to runWorker()
  • ROADMAP.md — Marks Phase 2 retry items as [x]

Closes #0056, #0057, #0058, #0059 on merge.

## Review: APPROVED ### Verification - `go vet ./...` — ✅ passes - `go build ./...` — ✅ passes - `golangci-lint v2 run ./...` — ✅ 0 issues ### Changes - `internal/config/config.go` — adds `MaxRetries`, `--retries`/`-r` flag, `PGET_RETRIES` env var, validation - `internal/downloader/download.go` — removes hardcoded `maxRetries` constant, parameter flows from config through `Download()` to `runWorker()` - `ROADMAP.md` — Marks Phase 2 retry items as [x] Closes #0056, #0057, #0058, #0059 on merge.
fuzzy merged commit 24214cd9a9 into main 2026-07-13 18:24:35 +00:00
fuzzy deleted branch feat/retry-backoff 2026-07-13 18:24:35 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/pget!145
No description provided.