Revision 658eb2dc src/Ganeti/Query/Server.hs
b/src/Ganeti/Query/Server.hs | ||
---|---|---|
359 | 359 |
return . Ok $ showJSON True |
360 | 360 |
else archiveFailed |
361 | 361 |
|
362 |
handleCall qlock _ cfg (AutoArchiveJobs age timeout) = do |
|
363 |
qDir <- queueDir |
|
364 |
eitherJids <- getJobIDs [qDir] |
|
365 |
case eitherJids of |
|
366 |
Left s -> return . Bad . JobQueueError $ show s |
|
367 |
Right jids -> do |
|
368 |
result <- bracket_ (takeMVar qlock) (putMVar qlock ()) |
|
369 |
. archiveJobs cfg age timeout |
|
370 |
$ sortJobIDs jids |
|
371 |
return . Ok $ showJSON result |
|
372 |
|
|
362 | 373 |
handleCall _ _ _ op = |
363 | 374 |
return . Bad $ |
364 | 375 |
GenericError ("Luxi call '" ++ strOfOp op ++ "' not implemented") |
Also available in: Unified diff