on master help sign in
Say "Still Alive" during checking for Travis
commitcb9526b2fdf130018714c43fe5129e1185612b05 authorMichael Snoyman <michael@snoyman.com> dateMon 5 Jan 2015, 17:08 (12 years ago) parent5cb4f05
1 file changed+13−1
Stackage/CompleteBuild.hs+13−1
Stackage/CompleteBuild.hs+13−1
@@ -8,6 +8,9 @@ module Stackage.CompleteBuild
88 , completeBuild
99 , justCheck
1010 ) where
11+
12+import Control.Concurrent (threadDelay)
13+import Control.Concurrent.Async (withAsync)
1114import Data.Default.Class (def)
1215import Data.Semigroup (Max (..), Option (..))
1316import Data.Text.Read (decimal)
@@ -145,11 +148,20 @@ renderLTSVer lts = fpFromText $ concat
145148 , ".yaml"
146149 ]
147150
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+
148160-- | Generate and check a new build plan, but do not execute it.
149161--
150162-- Since 0.3.1
151163justCheck :: IO ()
152−justCheck = withManager tlsManagerSettings $ \man -> do
164+justCheck = stillAlive $ withManager tlsManagerSettings $ \man -> do
153165 putStrLn "Loading build constraints"
154166 bc <- defaultBuildConstraints man
155167