mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user