Open dcastro opened 2 years ago
In runVaultIO, we're creating a new connection manager on every BackendEffect action:
runVaultIO
BackendEffect
env <- case url of (BaseUrl Http _ _ _) -> do manager <- embed $ newManager defaultManagerSettings pure $ mkClientEnv manager url (BaseUrl Https _ _ _) -> do manager <- embed $ newManager tlsManagerSettings pure $ mkClientEnv manager url
This can be observed by adding a trace statement:
manager <- embed $ do traceM "Creating manager" newManager defaultManagerSettings
And then running coffer view / (after creating a few entries):
coffer view /
$ cabal run exe:coffer -- view / "Creating manager" "Creating manager" "Creating manager" "Creating manager" "Creating manager" "Creating manager" "Creating manager" "Creating manager" / test/ ...
We should refactor this so only 1 connection manager is created.
In
runVaultIO
, we're creating a new connection manager on everyBackendEffect
action:This can be observed by adding a trace statement:
And then running
coffer view /
(after creating a few entries):We should refactor this so only 1 connection manager is created.