Revision ae66f3a9

b/src/Ganeti/JQueue.hs
33 33
    , queuedJobFromOpCodes
34 34
    , cancelQueuedJob
35 35
    , Timestamp
36
    , fromClockTime
36 37
    , noTimestamp
37 38
    , currentTimestamp
38 39
    , setReceivedTimestamp
......
107 108
noTimestamp :: Timestamp
108 109
noTimestamp = (-1, -1)
109 110

  
111
-- | Obtain a Timestamp from a given clock time
112
fromClockTime :: ClockTime -> Timestamp
113
fromClockTime (TOD ctime pico) =
114
  (fromIntegral ctime, fromIntegral $ pico `div` 1000000)
115

  
110 116
-- | Get the current time in the job-queue timestamp format.
111 117
currentTimestamp :: IO Timestamp
112
currentTimestamp = do
113
  TOD ctime pico <- getClockTime
114
  return (fromIntegral ctime, fromIntegral $ pico `div` 1000000)
118
currentTimestamp = fromClockTime `liftM` getClockTime
115 119

  
116 120
-- | An input opcode.
117 121
data InputOpCode = ValidOpCode MetaOpCode -- ^ OpCode was parsed successfully

Also available in: Unified diff