mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-31 01:23:50 +00:00
Update cache.lua
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user