Skip to content

Commit

Permalink
Merge #3987
Browse files Browse the repository at this point in the history
3987: [ADP-3063] Remove `ConnectionPool` r=HeinrichApfelmus a=HeinrichApfelmus

### Overview

This task is about removing the `ConnectionPool` type and `withConnectionPool` function.

Historically, the `ConnectionPool` was an attempt to enable concurrent reading from a database file. However, the present state of the code is that only a single connection is ever used per database file.

### Comments

* This fixes an issue where `runQuery` would close and open the database connection all the time — instead of working with a `pool :: ConnectionPool`, this function would work with a `fp :: FilePath`.

### Issue number

ADP-3063


Co-authored-by: Heinrich Apfelmus <heinrich.apfelmus@iohk.io>
Co-authored-by: paolino <paolo.veronelli@gmail.com>
  • Loading branch information
3 people committed Jun 7, 2023
2 parents 28bc1c9 + 4ccccce commit c160699
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 187 deletions.
5 changes: 1 addition & 4 deletions lib/wallet/bench/db-bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import Cardano.BM.Data.Tracer
import Cardano.BM.Setup
( setupTrace_, shutdown )
import Cardano.DB.Sqlite
( ConnectionPool, SqliteContext (..) )
( SqliteContext (..) )
import Cardano.Mnemonic
( EntropySize, SomeMnemonic (..), entropyToMnemonic, genEntropy )
import Cardano.Startup
Expand Down Expand Up @@ -790,9 +790,6 @@ instance NFData (DBLayer m s) where
instance NFData SqliteContext where
rnf _ = ()

instance NFData ConnectionPool where
rnf _ = ()

testCp :: WalletBench
testCp = snd $ initWallet block0 initDummySeqState

Expand Down
1 change: 0 additions & 1 deletion lib/wallet/cardano-wallet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ library
, quiet
, random
, random-shuffle
, resource-pool
, retry
, safe
, safe-money
Expand Down

0 comments on commit c160699

Please sign in to comment.