This commit is contained in:
Joey Hess 2025-02-26 14:05:37 -04:00
parent 3bec89a3c3
commit 53d107ca47
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 13 additions and 26 deletions

View file

@ -21,11 +21,9 @@ import Types.KeySource
import Messages.Progress
import Logs.Location
import Utility.Metered
import Utility.MonotonicClock
import Backend.URL (fromUrl)
import qualified Data.Map as M
import Data.Time.Clock
cmd :: Command
cmd = notBareRepo $
@ -92,17 +90,14 @@ perform o r = do
, Remote.Compute.computeReproducible = False
}
fast <- Annex.getRead Annex.fast
starttime <- liftIO currentMonotonicTimestamp
showOutput
Remote.Compute.runComputeProgram program state
(Remote.Compute.ImmutableState False)
(getInputContent fast)
(go starttime fast)
(go fast)
next $ return True
where
go starttime fast state tmpdir = do
endtime <- liftIO currentMonotonicTimestamp
let ts = calcduration starttime endtime
go fast state tmpdir ts = do
let outputs = Remote.Compute.computeOutputs state
when (M.null outputs) $
giveup "The computation succeeded, but it did not generate any files."
@ -151,9 +146,6 @@ perform o r = do
, checkWritePerms = True
}
calcduration (MonotonicTimestamp starttime) (MonotonicTimestamp endtime) =
fromIntegral (endtime - starttime) :: NominalDiffTime
isreproducible state = case reproducible o of
Just v -> isReproducible v
Nothing -> Remote.Compute.computeReproducible state