LGTM, thanks
On Mon, Dec 23, 2013 at 6:23 PM, Klaus Aehlig <[email protected]> wrote: > In order to obtain a higher throughput of jobs, schedule new jobs > as soon as a job was detected to have finished. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > src/Ganeti/JQScheduler.hs | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/src/Ganeti/JQScheduler.hs b/src/Ganeti/JQScheduler.hs > index 1924ad0..ad94b3c 100644 > --- a/src/Ganeti/JQScheduler.hs > +++ b/src/Ganeti/JQScheduler.hs > @@ -139,6 +139,10 @@ updateJob :: JQStatus -> JobWithStat -> IO () > updateJob state jb = do > jb' <- readJobStatus jb > maybe (return ()) (modifyJobs state . onRunningJobs . updateJobStatus) > jb' > + when (maybe True (jobFinalized . jJob) jb') . (>> return ()) . forkIO $ > do > + logDebug "Scheduler noticed a job to have finished." > + cleanupFinishedJobs state > + scheduleSomeJobs state > > -- | Sort out the finished jobs from the monitored part of the queue. > -- This is the pure part, splitting the queue into a remaining queue > -- > 1.8.5.1 > > -- -- Helga Velroyen | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
