remove excess log rotation; openLog rotates

This commit is contained in:
Joey Hess 2013-03-01 16:55:54 -04:00
parent 0d4b513ec2
commit 7a8833c81d

View file

@ -103,10 +103,7 @@ checkLogSize n = do
totalsize <- liftIO $ sum <$> mapM filesize logs
when (totalsize > oneMegabyte) $ do
notice ["Rotated logs due to size:", show totalsize]
liftIO $ do
rotateLog f
logfd <- openLog f
redirLog logfd
liftIO $ openLog f >>= redirLog
when (n < maxLogs + 1) $
checkLogSize $ n + 1
where