mirror of
https://github.com/therootcompany/golib.git
synced 2026-11-04 06:55:00 +00:00
fix(geoip-update): back off failed downloads
This commit is contained in:
parent
71f7752015
commit
05505c3554
@ -35,6 +35,8 @@ func printVersion(w io.Writer) {
|
||||
_, _ = fmt.Fprintf(w, "Licensed under %s\n", licenseType)
|
||||
}
|
||||
|
||||
const defaultFailureBackoff = 6 * time.Hour
|
||||
|
||||
type Config struct {
|
||||
ConfPath string
|
||||
Dir string
|
||||
@ -114,6 +116,7 @@ func main() {
|
||||
path,
|
||||
)
|
||||
cacher.MaxAge = maxAge
|
||||
cacher.FailureBackoff = defaultFailureBackoff
|
||||
cacher.Header = authHeader
|
||||
fmt.Fprintf(os.Stderr, "Fetching %s... ", edition)
|
||||
t := time.Now()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user