on master help sign in
Say "Still Alive" during checking for Travis
cb9526bMichael Snoyman
Stackage/CompleteBuild.hs+13−1
@@ -8,6 +8,9 @@ module Stackage.CompleteBuild
8 , completeBuild
8 , completeBuild
9 , justCheck
9 , justCheck
10 ) where
10 ) where
11+
12+import Control.Concurrent (threadDelay)
13+import Control.Concurrent.Async (withAsync)
11import Data.Default.Class (def)
14import Data.Default.Class (def)
12import Data.Semigroup (Max (..), Option (..))
15import Data.Semigroup (Max (..), Option (..))
13import Data.Text.Read (decimal)
16import Data.Text.Read (decimal)
@@ -145,11 +148,20 @@ renderLTSVer lts = fpFromText $ concat
145 , ".yaml"
148 , ".yaml"
146 ]
149 ]
147
150
151+-- | Just print a message saying "still alive" every second, to appease Travis.
152+stillAlive :: IO () -> IO ()
153+stillAlive inner =
154+ withAsync printer $ const inner
155+ where
156+ printer = forever $ do
157+ threadDelay 1000000
158+ putStrLn "Still alive"
159+
148-- | Generate and check a new build plan, but do not execute it.
160-- | Generate and check a new build plan, but do not execute it.
149--
161--
150-- Since 0.3.1
162-- Since 0.3.1
151justCheck :: IO ()
163justCheck :: IO ()
152−justCheck = withManager tlsManagerSettings $ \man -> do
164+justCheck = stillAlive $ withManager tlsManagerSettings $ \man -> do
153 putStrLn "Loading build constraints"
165 putStrLn "Loading build constraints"
154 bc <- defaultBuildConstraints man
166 bc <- defaultBuildConstraints man
155
167