LGTM, Thanks

On Wed, Dec 4, 2013 at 3:03 PM, Klaus Aehlig <[email protected]> wrote:

> Add a predicate jobs indicated that it has left the queue. This
> will be needed, to allow restarts of luxid (which now handles
> the queue) independent of jobs (currently running in masterd).
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/JQueue.hs | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/Ganeti/JQueue.hs b/src/Ganeti/JQueue.hs
> index c95499f..13e77e9 100644
> --- a/src/Ganeti/JQueue.hs
> +++ b/src/Ganeti/JQueue.hs
> @@ -38,6 +38,7 @@ module Ganeti.JQueue
>      , opStatusFinalized
>      , extractOpSummary
>      , calcJobStatus
> +    , jobStarted
>      , jobFinalized
>      , calcJobPriority
>      , jobFileName
> @@ -246,6 +247,10 @@ calcJobStatus QueuedJob { qjOps = ops } =
>             | otherwise        = extractOpSt xs (opStatusToJob x) new_all
>             where new_all = x == OP_STATUS_SUCCESS && old_all
>
> +-- | Determine if a job has started
> +jobStarted :: QueuedJob -> Bool
> +jobStarted = (> JOB_STATUS_QUEUED) . calcJobStatus
> +
>  -- | Determine if a job is finalised.
>  jobFinalized :: QueuedJob -> Bool
>  jobFinalized = (> JOB_STATUS_RUNNING) . calcJobStatus
> --
> 1.8.4.1
>
>

Reply via email to