Revision 95ee8abb

b/src/Ganeti/Jobs.hs
70 70
    waitForJobs' delay maxdelay = do
71 71
      -- TODO: this should use WaitForJobChange once it's available in Haskell
72 72
      -- land, instead of a fixed schedule of sleeping intervals.
73
      threadDelay $ min delay maxdelay
73
      threadDelay delay
74 74
      sts <- L.queryJobsStatus client jids
75 75
      case sts of
76 76
        Bad e -> return . Bad $ "Checking job status: " ++ formatError e
77 77
        Ok sts' -> if any (<= JOB_STATUS_RUNNING) sts' then
78
                     waitForJobs' (delay * 2) maxdelay
78
                     waitForJobs' (min (delay * 2) maxdelay) maxdelay
79 79
                   else
80 80
                     return . Ok $ zip jids sts'
81 81

  

Also available in: Unified diff