From: Tobias Ulmer Date: Tue, 30 Aug 2016 22:39:14 +0000 (+0200) Subject: cache: remove unused flags.refresh X-Git-Tag: e2factory-2.3.15rc1~116 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=370209101ec89ac6933555e3de2b9bfa36f26a34;p=e2factory.git cache: remove unused flags.refresh Signed-off-by: Tobias Ulmer --- diff --git a/generic/cache.lua b/generic/cache.lua index b655096..665bca0 100644 --- a/generic/cache.lua +++ b/generic/cache.lua @@ -55,7 +55,6 @@ local url = require("url") -- @class table -- @name flags -- @field cachable treat a server as cachable? --- @field refresh refresh a cached file? -- @field check_only check if a file is in the cache, without fetching --- Create a new cache. @@ -505,15 +504,13 @@ function cache.cache_file(c, server, location, flags) -- file is in the cache and just checking was requested return true end - if avail and not flags.refresh then - -- file is in the cache and no refresh requested - return true - end - local destdir = e2lib.join("/", ceurl.path, e2lib.dirname(location)) - -- fetch the file to the cache - rc, re = transport.fetch_file(ce.remote_url, location, destdir, nil) - if not rc then - return false, e:cat(re) + if not avail then + local destdir = e2lib.join("/", ceurl.path, e2lib.dirname(location)) + -- fetch the file to the cache + rc, re = transport.fetch_file(ce.remote_url, location, destdir, nil) + if not rc then + return false, e:cat(re) + end end return true end