forked from filipg/gonito
clean up variants
This commit is contained in:
parent
9b445d6e9c
commit
4dbf64ecfc
@ -279,7 +279,7 @@ getOuts chan submissionId = do
|
|||||||
activeTests <- runDB $ selectList [TestChallenge ==. challengeId, TestActive ==. True] []
|
activeTests <- runDB $ selectList [TestChallenge ==. challengeId, TestActive ==. True] []
|
||||||
testsDone <- filterM (liftIO . doesOutExist repoDir) activeTests
|
testsDone <- filterM (liftIO . doesOutExist repoDir) activeTests
|
||||||
theVariant <- getVariant submissionId "out"
|
theVariant <- getVariant submissionId "out"
|
||||||
outs <- mapM (outForTest repoDir submissionId theVariant) testsDone
|
outs <- mapM (outForTest repoDir theVariant) testsDone
|
||||||
mapM_ checkOrInsertOut outs
|
mapM_ checkOrInsertOut outs
|
||||||
mapM_ (checkOrInsertEvaluation repoDir chan) outs
|
mapM_ (checkOrInsertEvaluation repoDir chan) outs
|
||||||
return outs
|
return outs
|
||||||
@ -300,8 +300,8 @@ doesOutExist repoDir (Entity _ test) = do
|
|||||||
result <- findOutFile repoDir test
|
result <- findOutFile repoDir test
|
||||||
return $ isJust result
|
return $ isJust result
|
||||||
|
|
||||||
outForTest :: MonadIO m => FilePath -> Key Submission -> Key Variant -> Entity Test -> m Out
|
outForTest :: MonadIO m => FilePath -> Key Variant -> Entity Test -> m Out
|
||||||
outForTest repoDir submissionId variantId (Entity testId test) = do
|
outForTest repoDir variantId (Entity testId test) = do
|
||||||
(Just outF) <- liftIO $ findOutFile repoDir test
|
(Just outF) <- liftIO $ findOutFile repoDir test
|
||||||
checksum <- liftIO $ gatherSHA1ForCollectionOfFiles [outF]
|
checksum <- liftIO $ gatherSHA1ForCollectionOfFiles [outF]
|
||||||
return Out {
|
return Out {
|
||||||
|
Loading…
Reference in New Issue
Block a user