summaryrefslogtreecommitdiff
path: root/scripts/lua
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-10 21:50:55 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-10 21:50:55 +0100
commit6b9844d39af89d96cf78f9fffc0bfcfcf84e6ce3 (patch)
treebc27e6d0d633a8d2e2f7b035074ca8602208aca0 /scripts/lua
parent36026de28ad2878f3f48e30d46e5365a54d1c0cf (diff)
downloadmanaserv-6b9844d39af89d96cf78f9fffc0bfcfcf84e6ce3.tar.gz
manaserv-6b9844d39af89d96cf78f9fffc0bfcfcf84e6ce3.tar.bz2
manaserv-6b9844d39af89d96cf78f9fffc0bfcfcf84e6ce3.tar.xz
manaserv-6b9844d39af89d96cf78f9fffc0bfcfcf84e6ce3.zip
Avoid running newly scheduled jobs by using a fixed time point.
Reviewed-by: Thorbjorn.
Diffstat (limited to 'scripts/lua')
-rw-r--r--scripts/lua/libmana.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/lua/libmana.lua b/scripts/lua/libmana.lua
index 7084216e..62c089f8 100644
--- a/scripts/lua/libmana.lua
+++ b/scripts/lua/libmana.lua
@@ -343,7 +343,8 @@ end
function check_schedule()
if #scheduler_jobs==0 then return end
- while os.time() > scheduler_jobs[#scheduler_jobs][0] do
+ local current_time = os.time()
+ while current_time > scheduler_jobs[#scheduler_jobs][0] do
-- retreive the job and remove it from the schedule
job = scheduler_jobs[#scheduler_jobs]
table.remove(scheduler_jobs)