Fix source cache
This commit is contained in:
parent
5685844f43
commit
004fbef395
|
@ -31,8 +31,6 @@ type PluginsGlobals struct {
|
||||||
responsePlugins *[]Plugin
|
responsePlugins *[]Plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
var pluginsGlobals PluginsGlobals
|
|
||||||
|
|
||||||
type PluginsState struct {
|
type PluginsState struct {
|
||||||
sessionData map[string]interface{}
|
sessionData map[string]interface{}
|
||||||
action PluginsAction
|
action PluginsAction
|
||||||
|
|
|
@ -59,9 +59,9 @@ func fetchWithCache(url string, cacheFile string, refreshDelay time.Duration) (i
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
defer resp.Body.Close()
|
|
||||||
bin, err = ioutil.ReadAll(resp.Body)
|
bin, err = ioutil.ReadAll(resp.Body)
|
||||||
|
resp.Body.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if usableCache {
|
if usableCache {
|
||||||
bin, err = fetchFromCache(cacheFile)
|
bin, err = fetchFromCache(cacheFile)
|
||||||
|
@ -71,6 +71,7 @@ func fetchWithCache(url string, cacheFile string, refreshDelay time.Duration) (i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
in = string(bin)
|
in = string(bin)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue