mirror of
https://github.com/github/semantic.git
synced 2024-12-28 09:21:35 +03:00
Just one defaultConfig
This commit is contained in:
parent
033a748ed7
commit
21e3f69110
@ -48,11 +48,8 @@ data StatsAddr = StatsAddr { addrHost :: Stat.Host, addrPort :: Stat.Port }
|
||||
defaultOptions :: Options
|
||||
defaultOptions = Options (Just Warning) Nothing False
|
||||
|
||||
defaultConfig :: IO Config
|
||||
defaultConfig = defaultConfig' defaultOptions
|
||||
|
||||
defaultConfig' :: Options -> IO Config
|
||||
defaultConfig' options@Options{..} = do
|
||||
defaultConfig :: Options -> IO Config
|
||||
defaultConfig options@Options{..} = do
|
||||
pid <- getProcessID
|
||||
hostName <- getHostName
|
||||
isTerminal <- hIsTerminalDevice stderr
|
||||
|
@ -128,7 +128,7 @@ runTask = runTaskWithOptions defaultOptions
|
||||
-- | Execute a 'TaskEff' with the passed 'Options', yielding its result value in 'IO'.
|
||||
runTaskWithOptions :: Options -> TaskEff a -> IO a
|
||||
runTaskWithOptions opts task = do
|
||||
config <- defaultConfig' opts
|
||||
config <- defaultConfig opts
|
||||
result <- withTelemetry config $ \(TelemetryQueues logger statter _) ->
|
||||
runTaskWithConfig config logger statter task
|
||||
either (die . displayException) pure result
|
||||
|
@ -84,4 +84,4 @@ spec = do
|
||||
|
||||
-- Defaults are all driven by defaultConfig.
|
||||
defaultStatsClient :: IO StatsClient
|
||||
defaultStatsClient = defaultConfig >>= \Config{..} -> statsClient (addrHost configStatsAddr) (addrPort configStatsAddr) configAppName
|
||||
defaultStatsClient = defaultConfig defaultOptions >>= \Config{..} -> statsClient (addrHost configStatsAddr) (addrPort configStatsAddr) configAppName
|
||||
|
Loading…
Reference in New Issue
Block a user