Change expire["sofia_conf"] to expire["sofia"] and expire["acl_conf"] to expire["acl"]. Then add a default value to prevent nil errors when the conf.lua script has not been updated.

This commit is contained in:
markjcrane
2016-04-02 08:32:43 -06:00
parent 827c9d5a50
commit 11f4fea479
4 changed files with 16 additions and 6 deletions

View File

@@ -42,6 +42,11 @@
--set the cache
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
--set a default value
if (expire["acl"] == nil) then
expire["acl"]= "3600";
end
--connect to the database
require "resources.functions.database_handle";
dbh = database_handle('system');
@@ -103,7 +108,7 @@
dbh:release();
--set the cache
result = trim(api:execute("memcache", "set configuration:acl.conf '"..XML_STRING:gsub("'", "'").."' "..expire["acl_conf"]));
result = trim(api:execute("memcache", "set configuration:acl.conf '"..XML_STRING:gsub("'", "'").."' "..expire["acl"]));
--send the xml to the console
if (debug["xml_string"]) then

View File

@@ -35,6 +35,11 @@
--set the cache
if (XML_STRING == "-ERR NOT FOUND") or (XML_STRING == "-ERR CONNECTION FAILURE") then
--set a default value
if (expire["sofia"] == nil) then
expire["sofia"]= "3600";
end
--connect to the database
require "resources.functions.database_handle";
dbh = database_handle('system');
@@ -258,7 +263,7 @@
dbh:release();
--set the cache
result = trim(api:execute("memcache", "set configuration:sofia.conf:" .. hostname .." '"..XML_STRING:gsub("'", "'").."' "..expire["sofia_conf"]));
result = trim(api:execute("memcache", "set configuration:sofia.conf:" .. hostname .." '"..XML_STRING:gsub("'", "'").."' "..expire["sofia"]));
--send the xml to the console
if (debug["xml_string"]) then