Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions cardano-rpc/src/Cardano/Rpc/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,15 @@ methodsUtxoRpcSubmit =

runRpcServer
:: Tracer IO TraceRpc
-> IO (RpcConfig, NetworkMagic)
-- ^ action which reloads RPC configuration
-> (RpcConfig, NetworkMagic)
-> IO ()
runRpcServer tracer loadRpcConfig = handleFatalExceptions $ do
( rpcConfig@RpcConfig
{ isEnabled = Identity isEnabled
, rpcSocketPath = Identity (File rpcSocketPathFp)
, nodeSocketPath = Identity nodeSocketPath
}
, networkMagic
) <-
loadRpcConfig
let config =
runRpcServer tracer (rpcConfig, networkMagic) = handleFatalExceptions $ do
let RpcConfig
{ isEnabled = Identity isEnabled
, rpcSocketPath = Identity (File rpcSocketPathFp)
, nodeSocketPath = Identity nodeSocketPath
} = rpcConfig
config =
ServerConfig
{ serverInsecure = Just $ InsecureUnix rpcSocketPathFp
, serverSecure = Nothing
Expand All @@ -90,10 +86,6 @@ runRpcServer tracer loadRpcConfig = handleFatalExceptions $ do
, rpcLocalNodeConnectInfo = mkLocalNodeConnectInfo nodeSocketPath networkMagic
}

-- TODO this is logged by node configuration already, so it would make sense to log it again when
-- configuration gets reloaded
-- traceWith tracer $ "RPC configuration: " <> show rpcConfig

when isEnabled $
runRIO rpcEnv $
withRunInIO $ \runInIO ->
Expand Down
Loading