Commit 02e40b13 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Add a predicate to determine if a job has been started



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: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent a0ee4f12
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment