]> git.e2factory.org Git - e2factory.git/commitdiff
cache: export file_in_cache()
authorTobias Ulmer <tu@emlix.com>
Wed, 28 Jun 2017 15:04:10 +0000 (17:04 +0200)
committerTobias Ulmer <tu@emlix.com>
Mon, 10 Dec 2018 17:00:11 +0000 (18:00 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/cache.lua

index 1e522c73151a00740a6741d70f0b8c8f7d9cca96..83aa3d19ffdd5b61b81535ae64c985634f23900d 100644 (file)
@@ -419,7 +419,7 @@ end
 -- @return True if file is in cache, false otherwise
 -- @return Error object on failure
 -- @return Absolute filepath if it is in cache
-local function file_in_cache(c, server, location, flags)
+function cache.file_in_cache(c, server, location, flags)
     assertIsTable(c)
     assertIsStringN(server)
     assertIsStringN(location)
@@ -536,7 +536,7 @@ local function cache_file(c, server, location, flags)
     if not ceurl then
         return false, e:cat(re)
     end
-    local avail, re = file_in_cache(c, server, location)
+    local avail, re = cache.file_in_cache(c, server, location)
     if re then
         return false, e:cat(re)
     end
@@ -636,7 +636,7 @@ function cache.fetch_file_path(c, server, location, flags)
             return false, e:cat(re)
         end
 
-        rc, re, filepath = file_in_cache(c, server, location, flags)
+        rc, re, filepath = cache.file_in_cache(c, server, location, flags)
         if not rc and re then
             return false, e:cat(re)
         end
@@ -700,7 +700,7 @@ function cache.file_exists(c, server, location, flags)
     end
 
     if cache.cache_enabled(c, server, flags) then
-        rc, re = file_in_cache(c, server, location, flags)
+        rc, re = cache.file_in_cache(c, server, location, flags)
         if re then
             return false, e:cat(re)
         end