Commit eace5e94 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Only call 'listBuildTreeRefs' when actually needed.

parent 1929acb0
......@@ -141,15 +141,16 @@ maybeAddCompilerTimestampRecord :: Verbosity -> FilePath -> FilePath
-> IO ()
maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile
compId platform = do
buildTreeRefs <- listBuildTreeRefs verbosity DontListIgnored OnlyLinks
indexFile
withTimestampFile sandboxDir $ \timestampRecords -> do
let key = timestampRecordKey compId platform
case lookup key timestampRecords of
Just _ -> return timestampRecords
Nothing -> do now <- getCurTime
let timestamps = map (\p -> (p, now)) buildTreeRefs
return $ (key, timestamps):timestampRecords
Nothing -> do
buildTreeRefs <- listBuildTreeRefs verbosity DontListIgnored OnlyLinks
indexFile
now <- getCurTime
let timestamps = map (\p -> (p, now)) buildTreeRefs
return $ (key, timestamps):timestampRecords
-- | Given an IO action that returns a list of build tree refs, add those
-- build tree refs to the timestamps file (for all compilers).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment