Revision c6013594 src/Ganeti/Query/Server.hs

b/src/Ganeti/Query/Server.hs
34 34
import Control.Applicative
35 35
import Control.Concurrent
36 36
import Control.Exception
37
import Control.Monad (forever, when, zipWithM)
37
import Control.Monad (forever, when, zipWithM, liftM)
38 38
import Data.Bits (bitSize)
39 39
import qualified Data.Set as Set (toList)
40 40
import Data.IORef
......
205 205
    case jobid of
206 206
      Bad s -> return . Bad . GenericError $ s
207 207
      Ok jid -> do
208
        ts <- currentTimestamp
209
        job <- liftM (setReceivedTimestamp ts)
210
                 $ queuedJobFromOpCodes jid ops
208 211
        qDir <- queueDir
209
        job <- queuedJobFromOpCodes jid ops
210 212
        write_result <- writeJobToDisk qDir job
211 213
        case write_result of
212 214
          Bad s -> return . Bad . GenericError $ s
......
233 235
        case result_jobids of
234 236
          Bad s -> return . Bad . GenericError $ s
235 237
          Ok jids -> do
236
            jobs <- zipWithM queuedJobFromOpCodes jids lops
238
            ts <- currentTimestamp
239
            jobs <- liftM (map $ setReceivedTimestamp ts)
240
                      $ zipWithM queuedJobFromOpCodes jids lops
237 241
            qDir <- queueDir
238 242
            write_results <- mapM (writeJobToDisk qDir) jobs
239 243
            let annotated_results = zip write_results jobs

Also available in: Unified diff