Skip to content

Commit 017cae4

Browse files
authored
Merge pull request #2797 from IntersectMBO/staging
chore: adjust connection pooling
2 parents a76762f + a695b5a commit 017cae4

File tree

5 files changed

+193
-170
lines changed

5 files changed

+193
-170
lines changed

govtool/backend/app/Main.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ createOptimizedConnectionPool :: BS.ByteString -> IO (Pool Connection)
7070
createOptimizedConnectionPool connectionString = createPool
7171
(connectPostgreSQL connectionString) -- Connection creation function
7272
close -- Connection destruction function
73-
1 -- Number of stripes (sub-pools)
74-
60 -- Idle timeout (seconds)
75-
50 -- Maximum number of connections per stripe
73+
1 -- Idle timeout (seconds)
74+
2 -- Number of stripes (sub-pools)
75+
60 -- Maximum number of connections per stripe
7676

7777
proxyAPI :: Proxy (VVAApi :<|> SwaggerAPI)
7878
proxyAPI = Proxy

govtool/backend/src/VVA/AdaHolder.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,9 @@ getStakeKeyVotingPower stakeKey = withPool $ \conn -> do
6060
Text.putStrLn ("couldn't fetch voting power for stake key: " <> stakeKey)
6161
return 0
6262
Right [(votingPower,_)] -> return $ floor votingPower
63-
_ -> error ("multiple voting power entries for stake key: " <> unpack stakeKey)
63+
Right [] -> do
64+
Text.putStrLn ("No voting power found for stake key: " <> stakeKey)
65+
return 0
66+
Right _ -> do
67+
Text.putStrLn ("Unexpected result for stake key: " <> stakeKey)
68+
return 0

0 commit comments

Comments
 (0)