Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
pcapriotti committed Dec 7, 2023
1 parent d4d6587 commit faf0d77
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions integration/test/Testlib/ModService.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# OPTIONS_GHC -Wwarn #-}

module Testlib.ModService
( withModifiedBackend,
Expand Down Expand Up @@ -525,17 +523,16 @@ server 127.0.0.1:{port} max_fails=3 weight=1;
startNginz :: String -> FilePath -> FilePath -> IO ProcessHandle
startNginz domain conf workingDir = do
(_, Just stdoutHdl, Just stderrHdl, ph) <-
liftIO $
createProcess
(proc "nginx" ["-c", conf, "-g", "daemon off;", "-e", "/dev/stdout"])
{ cwd = Just workingDir,
std_out = CreatePipe,
std_err = CreatePipe
}
createProcess
(proc "nginx" ["-c", conf, "-g", "daemon off;", "-e", "/dev/stdout"])
{ cwd = Just workingDir,
std_out = CreatePipe,
std_err = CreatePipe
}

let prefix = "[" <> "nginz" <> "@" <> domain <> "] "
let colorize = fromMaybe id (lookup "nginx" processColors)
void $ liftIO $ forkIO $ logToConsole colorize prefix stdoutHdl
void $ liftIO $ forkIO $ logToConsole colorize prefix stderrHdl
void $ forkIO $ logToConsole colorize prefix stdoutHdl
void $ forkIO $ logToConsole colorize prefix stderrHdl

pure ph

0 comments on commit faf0d77

Please sign in to comment.