diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs index ab972e6d89..0a1b156990 100644 --- a/Assistant/Threads/SanityChecker.hs +++ b/Assistant/Threads/SanityChecker.hs @@ -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