Browse Source

Bump to lts-17.14

master
Denis Tereshkin 4 years ago
parent
commit
018b247aac
  1. 7
      atrade-monitor.cabal
  2. 6
      src/Main.hs
  3. 3
      stack.yaml

7
atrade-monitor.cabal

@ -1,10 +1,10 @@
cabal-version: 1.12 cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.31.2. -- This file has been generated from package.yaml by hpack version 0.34.4.
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --
-- hash: dab67d56afaa7dcc061e0130cc7ad1f8d8d8fc8b43f6d30a8662091a0a8bd9ac -- hash: 4141f70beaab8672b6e6b4e228dcd630fdb6ab5cb7e81f88d9c047293d6b1081
name: atrade-monitor name: atrade-monitor
version: 0.1.0.0 version: 0.1.0.0
@ -25,7 +25,8 @@ executable atrade-monitor
Paths_atrade_monitor Paths_atrade_monitor
hs-source-dirs: hs-source-dirs:
src src
default-extensions: OverloadedStrings default-extensions:
OverloadedStrings
ghc-options: -threaded ghc-options: -threaded
build-depends: build-depends:
aeson aeson

6
src/Main.hs

@ -77,9 +77,11 @@ main = do
runWithConfig :: Config -> IO () runWithConfig :: Config -> IO ()
runWithConfig config = do runWithConfig config = do
(inChan, outChan) <- newChan (inChan, outChan) <- newChan
threadIds <- forM (zip [0..] (cExecutables config)) $ \(i, execcfg) -> do threadIds <- forM (zip [0..] (cExecutables config)) $ \(i, execcfg) ->
threadDelay (1000000 * i * cDelay config)
forkIO $ do forkIO $ do
let delay = 1000000 * i * cDelay config
putStrLn $ "Waiting " ++ show delay ++ " to spawn process: " ++ cExecutablePath execcfg
threadDelay delay
putStrLn $ "Creating process: " ++ cExecutablePath execcfg putStrLn $ "Creating process: " ++ cExecutablePath execcfg
(_, Just stdOut, Just stdErr, ph) <- createProcess $ (proc (cExecutablePath execcfg) (makeArgs (cGlobalArgs config) (cArgs execcfg))) { std_out = CreatePipe, std_err = CreatePipe } (_, Just stdOut, Just stdErr, ph) <- createProcess $ (proc (cExecutablePath execcfg) (makeArgs (cGlobalArgs config) (cArgs execcfg))) { std_out = CreatePipe, std_err = CreatePipe }
withFile (cLogPath execcfg) AppendMode $ \log -> handleIO (exceptionHandler inChan) $ do withFile (cLogPath execcfg) AppendMode $ \log -> handleIO (exceptionHandler inChan) $ do

3
stack.yaml

@ -18,7 +18,7 @@
# #
# resolver: ./custom-snapshot.yaml # resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml # resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-12.9 resolver: lts-17.14
# User packages to be built. # User packages to be built.
# Various formats can be used as shown in the example below. # Various formats can be used as shown in the example below.
@ -39,7 +39,6 @@ packages:
# using the same syntax as the packages field. # using the same syntax as the packages field.
# (e.g., acme-missiles-0.3) # (e.g., acme-missiles-0.3)
extra-deps: extra-deps:
- unagi-chan-0.4.1.0
- posix-pty-0.2.1.1 - posix-pty-0.2.1.1
# Override default flag values for local packages and extra-deps # Override default flag values for local packages and extra-deps

Loading…
Cancel
Save