From 5ddedc8afa37982e41104ccecb5cddf4792a9025 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 22 Jul 2017 15:17:11 -0600 Subject: [PATCH] Update cache.lua --- resources/install/scripts/resources/functions/cache.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/install/scripts/resources/functions/cache.lua b/resources/install/scripts/resources/functions/cache.lua index bcd3d8ce5b..ce8a2f0b0f 100644 --- a/resources/install/scripts/resources/functions/cache.lua +++ b/resources/install/scripts/resources/functions/cache.lua @@ -81,9 +81,16 @@ function Cache.get(key) end if (cache.method == "file") then if (file_exists(cache.location .. "/" .. key)) then - local result, err = io.open(cache.location .. "/" .. key, "rb") + --freeswitch.consoleLog("notice", "[cache] location: " .. cache.location .. "/" .. key .."\n"); + local file, err = io.open(cache.location .. "/" .. key, "rb") + result = file:read("*all") + err = ''; + else + err = 'NOT FOUND'; end end + --freeswitch.consoleLog("notice", "[cache] result: " .. result .. "\n"); + --file:close() if not result then return nil, err end return (result:gsub("'", "'")) end