Skip to content

Commit 712869e

Browse files
authored
Merge pull request #215 from maralorn/more-reordering
More reordering
2 parents 3d9bf2f + 12dcd60 commit 712869e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/NOM/Update/Monad/CacheBuildReports.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ saveBuildReports dir reports = catchIO trySave mempty
122122
createDirectoryIfMissing True dir
123123
writeFileLBS (dir </> buildReportsFilename) (encodeDefaultOrderedByName . toCSV $ reports)
124124

125+
toCSV :: BuildReportMap -> [BuildReport]
126+
toCSV = fmap toCSVLine . traverse Map.assocs <=< Map.assocs
127+
128+
toCSVLine :: ((Host, Text), (UTCTime, Int)) -> BuildReport
129+
toCSVLine ((host, drvName), (endTime, buildSecs)) = BuildReport{..}
130+
125131
loadBuildReports :: FilePath -> IO BuildReportMap
126132
loadBuildReports dir = catchIO tryLoad mempty
127133
where
@@ -130,12 +136,6 @@ loadBuildReports dir = catchIO tryLoad mempty
130136
>>= (toLazy >>> decodeByName >>> either (const $ fail "Could not parse CSV") (pure . snd))
131137
<&> (toList >>> fromCSV)
132138

133-
toCSV :: BuildReportMap -> [BuildReport]
134-
toCSV = fmap toCSVLine . traverse Map.assocs <=< Map.assocs
135-
136-
toCSVLine :: ((Host, Text), (UTCTime, Int)) -> BuildReport
137-
toCSVLine ((host, drvName), (endTime, buildSecs)) = BuildReport{..}
138-
139139
fromCSV :: [BuildReport] -> BuildReportMap
140140
fromCSV = fmap fromCSVLine >>> Map.fromListWith Map.union
141141

0 commit comments

Comments
 (0)