Add Debug flag
This commit is contained in:
parent
706de89156
commit
37c9d25990
@ -12,7 +12,6 @@ import Control.Applicative ((<|>))
|
|||||||
import Control.Concurrent (threadDelay)
|
import Control.Concurrent (threadDelay)
|
||||||
import Control.Concurrent.Async (race_)
|
import Control.Concurrent.Async (race_)
|
||||||
import Control.Concurrent.STM
|
import Control.Concurrent.STM
|
||||||
import Control.Concurrent.MVar
|
|
||||||
import qualified Control.Exception.Safe as Ex
|
import qualified Control.Exception.Safe as Ex
|
||||||
import Control.Monad (forever, unless, void,
|
import Control.Monad (forever, unless, void,
|
||||||
when)
|
when)
|
||||||
@ -145,6 +144,9 @@ reverseProxy opts appPortVar = do
|
|||||||
let proxyApp = waiProxyToSettings
|
let proxyApp = waiProxyToSettings
|
||||||
(const $ do
|
(const $ do
|
||||||
appPort <- atomically $ readTVar appPortVar
|
appPort <- atomically $ readTVar appPortVar
|
||||||
|
#if DEBUG
|
||||||
|
print $ "revProxy: appPort " ++ (show appPort)
|
||||||
|
#endif
|
||||||
return $
|
return $
|
||||||
ReverseProxy.WPRProxyDest
|
ReverseProxy.WPRProxyDest
|
||||||
$ ProxyDest "127.0.0.1" appPort)
|
$ ProxyDest "127.0.0.1" appPort)
|
||||||
@ -244,11 +246,22 @@ updateAppPort bs buildStarted appPortVar = do
|
|||||||
let buildEnd = isInfixOf stackFailureString bs || isInfixOf stackSuccessString bs
|
let buildEnd = isInfixOf stackFailureString bs || isInfixOf stackSuccessString bs
|
||||||
case (hasStarted, buildEnd) of
|
case (hasStarted, buildEnd) of
|
||||||
(False, False) -> do
|
(False, False) -> do
|
||||||
|
#if DEBUG
|
||||||
|
print "updated appPortVar to -1"
|
||||||
|
#endif
|
||||||
atomically $ do
|
atomically $ do
|
||||||
writeTVar appPortVar (-1 :: Int)
|
writeTVar appPortVar (-1 :: Int)
|
||||||
writeTVar buildStarted True
|
writeTVar buildStarted True
|
||||||
(True, False) -> return ()
|
(True, False) -> do
|
||||||
(_, True) -> atomically $ writeTVar buildStarted False
|
#if DEBUG
|
||||||
|
print "ignored"
|
||||||
|
#endif
|
||||||
|
return ()
|
||||||
|
(_, True) -> do
|
||||||
|
#if DEBUG
|
||||||
|
print "Reset buildStarted to False"
|
||||||
|
#endif
|
||||||
|
atomically $ writeTVar buildStarted False
|
||||||
|
|
||||||
-- | Get the set of all flags available in the given cabal file
|
-- | Get the set of all flags available in the given cabal file
|
||||||
getAvailableFlags :: D.GenericPackageDescription -> Set.Set String
|
getAvailableFlags :: D.GenericPackageDescription -> Set.Set String
|
||||||
@ -383,6 +396,7 @@ devel opts passThroughArgs = do
|
|||||||
inner changedVar
|
inner changedVar
|
||||||
|
|
||||||
-- Each time the library builds successfully, run the application
|
-- Each time the library builds successfully, run the application
|
||||||
|
runApp :: TVar Int -> TVar Bool -> String -> IO b
|
||||||
runApp appPortVar changedVar develHsPath = do
|
runApp appPortVar changedVar develHsPath = do
|
||||||
-- Wait for the first change, indicating that the library
|
-- Wait for the first change, indicating that the library
|
||||||
-- has been built
|
-- has been built
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod
|
name: yesod
|
||||||
version: 1.4.5
|
version: 1.4.6
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user