mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-07 07:07:37 +03:00
Improved error handling
This commit is contained in:
parent
7fbb4c5428
commit
1c27d6c230
2 changed files with 72 additions and 91 deletions
|
@ -187,10 +187,14 @@ func (proxy *Proxy) prefetcher(urlsToPrefetch *[]URLToPrefetch) {
|
|||
urlToPrefetch := &(*urlsToPrefetch)[i]
|
||||
if now.After(urlToPrefetch.when) {
|
||||
dlog.Debugf("Prefetching [%s]", urlToPrefetch.url)
|
||||
PrefetchSourceURL(urlToPrefetch)
|
||||
if err := PrefetchSourceURL(urlToPrefetch); err != nil {
|
||||
dlog.Debugf("Prefetching [%s] failed: %s", err)
|
||||
} else {
|
||||
dlog.Debugf("Prefetching [%s] succeeded. Next refresh scheduled for %v", urlToPrefetch.url, urlToPrefetch.when)
|
||||
}
|
||||
}
|
||||
}
|
||||
time.Sleep(60 * time.Second)
|
||||
time.Sleep(5 * time.Second)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue