added variable runonce to prevent the loop. Have seen this script crash a busy FS install. Now possible to run via cron.

This commit is contained in:
James Rose
2014-07-31 20:15:06 +00:00
parent 41dee53163
commit c1fb9b76b2

View File

@@ -36,6 +36,8 @@
debug["sql"] = false;
debug["info"] = false;
--only run the script a single time
runonce = true
--connect to the database
dofile(scripts_dir.."/resources/functions/database_handle.lua");
dbh = database_handle('system');
@@ -116,9 +118,12 @@
end
end);
--slow the loop down
if (runonce) then
freeswitch.consoleLog("notice", "mwi.lua has ended\n");
break;
else
--slow the loop down
os.execute("sleep "..sleep);
--testing exit immediately
--break;
end
end