From 6b9844d39af89d96cf78f9fffc0bfcfcf84e6ce3 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Thu, 10 Mar 2011 21:50:55 +0100 Subject: Avoid running newly scheduled jobs by using a fixed time point. Reviewed-by: Thorbjorn. --- scripts/lua/libmana.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/lua') 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) -- cgit v1.2.3-70-g09d2