LGTM, thanks.

On Wed, Feb 5, 2014 at 2:49 PM, Klaus Aehlig <[email protected]> wrote:

> ...by changing the priority of the non-finished opcodes.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/JQueue.hs | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/Ganeti/JQueue.hs b/src/Ganeti/JQueue.hs
> index c5fd67e..fdd794f 100644
> --- a/src/Ganeti/JQueue.hs
> +++ b/src/Ganeti/JQueue.hs
> @@ -32,6 +32,7 @@ module Ganeti.JQueue
>      , queuedOpCodeFromMetaOpCode
>      , queuedJobFromOpCodes
>      , changeOpCodePriority
> +    , changeJobPriority
>      , cancelQueuedJob
>      , Timestamp
>      , fromClockTime
> @@ -228,6 +229,12 @@ cancelOpCode :: Timestamp -> QueuedOpCode ->
> QueuedOpCode
>  cancelOpCode now op =
>    op { qoStatus = OP_STATUS_CANCELED, qoEndTimestamp = Just now }
>
> +-- | Change the priority of a job, i.e., change the priority of the
> +-- non-finalized opcodes.
> +changeJobPriority :: Int -> QueuedJob -> QueuedJob
> +changeJobPriority prio job =
> +  job { qjOps = map (changeOpCodePriority prio) $ qjOps job }
> +
>  -- | Transform a QueuedJob that has not been started into its canceled
> form.
>  cancelQueuedJob :: Timestamp -> QueuedJob -> QueuedJob
>  cancelQueuedJob now job =
> --
> 1.9.0.rc1.175.g0b1dcb5
>
>

Reply via email to