mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Allow getJSON errors to be ignored
This change is mostly motivated to get a more stable CI build (we're building the Hugo site there, with Instagram and Twitter shortcodes sometimes failing). Fixes #7866
This commit is contained in:
@@ -45,7 +45,7 @@ func (ns *Namespace) getRemote(cache *filecache.Cache, unmarshal func([]byte) (b
|
||||
var err error
|
||||
handled = true
|
||||
for i := 0; i <= resRetries; i++ {
|
||||
ns.deps.Log.INFO.Printf("Downloading: %s ...", url)
|
||||
ns.deps.Log.Infof("Downloading: %s ...", url)
|
||||
var res *http.Response
|
||||
res, err = ns.client.Do(req)
|
||||
if err != nil {
|
||||
@@ -75,8 +75,8 @@ func (ns *Namespace) getRemote(cache *filecache.Cache, unmarshal func([]byte) (b
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ns.deps.Log.INFO.Printf("Cannot read remote resource %s: %s", url, err)
|
||||
ns.deps.Log.INFO.Printf("Retry #%d for %s and sleeping for %s", i+1, url, resSleep)
|
||||
ns.deps.Log.Infof("Cannot read remote resource %s: %s", url, err)
|
||||
ns.deps.Log.Infof("Retry #%d for %s and sleeping for %s", i+1, url, resSleep)
|
||||
time.Sleep(resSleep)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user