fix(geoip-update): back off failed downloads

This commit is contained in:
AJ ONeal 2026-09-08 14:44:48 -06:00
parent 71f7752015
commit 05505c3554
No known key found for this signature in database

View File

@ -35,10 +35,12 @@ func printVersion(w io.Writer) {
_, _ = fmt.Fprintf(w, "Licensed under %s\n", licenseType) _, _ = fmt.Fprintf(w, "Licensed under %s\n", licenseType)
} }
const defaultFailureBackoff = 6 * time.Hour
type Config struct { type Config struct {
ConfPath string ConfPath string
Dir string Dir string
BaseURL string BaseURL string
FreshDays int FreshDays int
} }
@ -114,6 +116,7 @@ func main() {
path, path,
) )
cacher.MaxAge = maxAge cacher.MaxAge = maxAge
cacher.FailureBackoff = defaultFailureBackoff
cacher.Header = authHeader cacher.Header = authHeader
fmt.Fprintf(os.Stderr, "Fetching %s... ", edition) fmt.Fprintf(os.Stderr, "Fetching %s... ", edition)
t := time.Now() t := time.Now()