Reduce logging further

This commit is contained in:
Manuel 2021-06-05 23:34:12 +02:00
parent 6c153d6bf1
commit 459c2dd158
Signed by: Manuel
GPG key ID: 4085037435E1F07A

View file

@ -83,9 +83,9 @@ startCleanup = do
timer t = forever $ do timer t = forever $ do
-- Takes time in microseconds -- Takes time in microseconds
threadDelay $ t * 60000000 threadDelay $ t * 60000000
logInfo ["Starting cleanup of containers"] logDebug ["Starting cleanup of containers"]
n <- killContainers n <- killContainers
logInfo ["Cleaned up ", cs $ show n, " containers, next in ", cs $ show t, " minutes"] logDebug ["Cleaned up ", cs $ show n, " containers, next in ", cs $ show t, " minutes"]
timer t timer t
setupContainer :: Language -> Myriad ContainerName setupContainer :: Language -> Myriad ContainerName
@ -152,9 +152,9 @@ killContainer lang = do
killContainers :: Myriad [ContainerName] killContainers :: Myriad [ContainerName]
killContainers = do killContainers = do
containers <- gview #containers >>= readMVar containers <- gview #containers >>= readMVar
logInfo ["Starting killing of containers"] logDebug ["Starting killing of containers"]
xs <- forConcurrently (M.toList containers) $ \(k, v) -> (v,) <$> killContainer k xs <- forConcurrently (M.toList containers) $ \(k, v) -> (v,) <$> killContainer k
logInfo ["Finished killing of containers"] logDebug ["Finished killing of containers"]
pure . map fst $ filter snd xs pure . map fst $ filter snd xs
evalCode :: Language -> Int -> String -> Myriad EvalResult evalCode :: Language -> Int -> String -> Myriad EvalResult