convert getFileSize to RawFilePath
Lots of nice wins from this in avoiding unncessary work, and I think nothing got slower. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
This commit is contained in:
parent
2670af9d5a
commit
9b0dde834e
34 changed files with 79 additions and 70 deletions
|
@ -223,7 +223,7 @@ checkLogSize :: Int -> Assistant ()
|
|||
checkLogSize n = do
|
||||
f <- liftAnnex $ fromRawFilePath <$> fromRepo gitAnnexDaemonLogFile
|
||||
logs <- liftIO $ listLogs f
|
||||
totalsize <- liftIO $ sum <$> mapM getFileSize logs
|
||||
totalsize <- liftIO $ sum <$> mapM (getFileSize . toRawFilePath) logs
|
||||
when (totalsize > 2 * oneMegabyte) $ do
|
||||
notice ["Rotated logs due to size:", show totalsize]
|
||||
liftIO $ openLog f >>= handleToFd >>= redirLog
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue