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 (TestProgressR _) _ = isTrustedAuthorized
|
||||
isAuthorized (TestProgressR _ _) _ = isTrustedAuthorized
|
||||
|
||||
isAuthorized SwaggerR _ = return Authorized
|
||||
|
||||
|
@ -1333,13 +1333,13 @@ challengeLayout withHeader challenge widget = do
|
||||
setTitle "Challenge"
|
||||
$(widgetFile "challenge")
|
||||
|
||||
getTestProgressR :: Int -> Handler TypedContent
|
||||
getTestProgressR m = runViewProgress $ doTestProgress m
|
||||
getTestProgressR :: Int -> Int -> Handler TypedContent
|
||||
getTestProgressR m d = runViewProgress $ doTestProgress m d
|
||||
|
||||
doTestProgress :: Int -> Channel -> Handler ()
|
||||
doTestProgress m chan = do
|
||||
doTestProgress :: Int -> Int -> Channel -> Handler ()
|
||||
doTestProgress m d chan = do
|
||||
forM [1..m] $ (\i -> do
|
||||
msg chan $ (Data.Text.pack $ ("GO\n" ++ show i))
|
||||
liftIO $ threadDelay 1000000
|
||||
liftIO $ threadDelay (d * 1000000)
|
||||
return ())
|
||||
return ()
|
||||
|
@ -10,7 +10,7 @@
|
||||
/view-progress/#Int ViewProgressR GET
|
||||
/open-view-progress/#Int OpenViewProgressR GET
|
||||
/view-progress-with-web-sockets/#Int ViewProgressWithWebSocketsR GET
|
||||
/test-progress/#Int TestProgressR GET
|
||||
/test-progress/#Int/#Int TestProgressR GET
|
||||
/list-challenges ListChallengesR GET
|
||||
|
||||
/api/list-challenges ListChallengesJsonR GET
|
||||
|
Loading…
Reference in New Issue
Block a user