Fix source cache

This commit is contained in:
Frank Denis 2018-01-16 00:37:04 +01:00
parent 5685844f43
commit 004fbef395
2 changed files with 9 additions and 10 deletions

View File

@ -31,8 +31,6 @@ type PluginsGlobals struct {
responsePlugins *[]Plugin
}
var pluginsGlobals PluginsGlobals
type PluginsState struct {
sessionData map[string]interface{}
action PluginsAction

View File

@ -59,9 +59,9 @@ func fetchWithCache(url string, cacheFile string, refreshDelay time.Duration) (i
if err != nil {
return
}
}
defer resp.Body.Close()
} else {
bin, err = ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
if usableCache {
bin, err = fetchFromCache(cacheFile)
@ -71,6 +71,7 @@ func fetchWithCache(url string, cacheFile string, refreshDelay time.Duration) (i
}
}
}
}
in = string(bin)
return
}