LGTM, thanks.

On Thu, Jan 23, 2014 at 11:01 PM, Klaus Aehlig <[email protected]> wrote:

> As timestamps are also used to determine if an event is sufficiently
> long in the past (e.g., on archiving jobs), support adding a time
> interval to a Timestamp.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/JQueue.hs | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/Ganeti/JQueue.hs b/src/Ganeti/JQueue.hs
> index f384de3..c706f1c 100644
> --- a/src/Ganeti/JQueue.hs
> +++ b/src/Ganeti/JQueue.hs
> @@ -36,6 +36,7 @@ module Ganeti.JQueue
>      , fromClockTime
>      , noTimestamp
>      , currentTimestamp
> +    , advanceTimestamp
>      , setReceivedTimestamp
>      , opStatusFinalized
>      , extractOpSummary
> @@ -63,7 +64,7 @@ module Ganeti.JQueue
>      ) where
>
>  import Control.Applicative (liftA2, (<|>))
> -import Control.Arrow (second)
> +import Control.Arrow (first, second)
>  import Control.Concurrent.MVar
>  import Control.Exception
>  import Control.Monad
> @@ -117,6 +118,11 @@ fromClockTime (TOD ctime pico) =
>  currentTimestamp :: IO Timestamp
>  currentTimestamp = fromClockTime `liftM` getClockTime
>
> +-- | From a given timestamp, obtain the timestamp of the
> +-- time that is the given number of seconds later.
> +advanceTimestamp :: Int -> Timestamp -> Timestamp
> +advanceTimestamp = first . (+)
> +
>  -- | An input opcode.
>  data InputOpCode = ValidOpCode MetaOpCode -- ^ OpCode was parsed
> successfully
>                   | InvalidOpCode JSValue  -- ^ Invalid opcode
> --
> 1.8.5.3
>
>

Reply via email to