forked from filipg/gonito
Improve diagnostics of generating output
This commit is contained in:
parent
04beeffbb4
commit
c176c65393
@ -225,7 +225,7 @@ instance Yesod App where
|
|||||||
|
|
||||||
isAuthorized (CompareFormR _ _) _ = regularAuthorization
|
isAuthorized (CompareFormR _ _) _ = regularAuthorization
|
||||||
|
|
||||||
isAuthorized (TestProgressR _) _ = isTrustedAuthorized
|
isAuthorized (TestProgressR _ _) _ = isTrustedAuthorized
|
||||||
|
|
||||||
isAuthorized SwaggerR _ = return Authorized
|
isAuthorized SwaggerR _ = return Authorized
|
||||||
|
|
||||||
|
@ -1333,13 +1333,13 @@ challengeLayout withHeader challenge widget = do
|
|||||||
setTitle "Challenge"
|
setTitle "Challenge"
|
||||||
$(widgetFile "challenge")
|
$(widgetFile "challenge")
|
||||||
|
|
||||||
getTestProgressR :: Int -> Handler TypedContent
|
getTestProgressR :: Int -> Int -> Handler TypedContent
|
||||||
getTestProgressR m = runViewProgress $ doTestProgress m
|
getTestProgressR m d = runViewProgress $ doTestProgress m d
|
||||||
|
|
||||||
doTestProgress :: Int -> Channel -> Handler ()
|
doTestProgress :: Int -> Int -> Channel -> Handler ()
|
||||||
doTestProgress m chan = do
|
doTestProgress m d chan = do
|
||||||
forM [1..m] $ (\i -> do
|
forM [1..m] $ (\i -> do
|
||||||
msg chan $ (Data.Text.pack $ ("GO\n" ++ show i))
|
msg chan $ (Data.Text.pack $ ("GO\n" ++ show i))
|
||||||
liftIO $ threadDelay 1000000
|
liftIO $ threadDelay (d * 1000000)
|
||||||
return ())
|
return ())
|
||||||
return ()
|
return ()
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
/view-progress/#Int ViewProgressR GET
|
/view-progress/#Int ViewProgressR GET
|
||||||
/open-view-progress/#Int OpenViewProgressR GET
|
/open-view-progress/#Int OpenViewProgressR GET
|
||||||
/view-progress-with-web-sockets/#Int ViewProgressWithWebSocketsR GET
|
/view-progress-with-web-sockets/#Int ViewProgressWithWebSocketsR GET
|
||||||
/test-progress/#Int TestProgressR GET
|
/test-progress/#Int/#Int TestProgressR GET
|
||||||
/list-challenges ListChallengesR GET
|
/list-challenges ListChallengesR GET
|
||||||
|
|
||||||
/api/list-challenges ListChallengesJsonR GET
|
/api/list-challenges ListChallengesJsonR GET
|
||||||
|
Loading…
Reference in New Issue
Block a user