From 2a73277ecdd2e8f4287d990dd9bc1704cc01815f Mon Sep 17 00:00:00 2001 From: kewaopcode <64617713+kewaopcode@users.noreply.github.com> Date: Mon, 27 Oct 2025 03:48:06 +0300 Subject: [PATCH] update resource-pool to newer versions --- src/Snap/Snaplet/PostgresqlSimple/Internal.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Snap/Snaplet/PostgresqlSimple/Internal.hs b/src/Snap/Snaplet/PostgresqlSimple/Internal.hs index be80498..f4cb05f 100644 --- a/src/Snap/Snaplet/PostgresqlSimple/Internal.hs +++ b/src/Snap/Snaplet/PostgresqlSimple/Internal.hs @@ -141,12 +141,12 @@ pgsDefaultConfig connstr = PGSConfig connstr 1 5 20 -- where you have common code (that requires a database connection) that you wish to call from -- other blocks of code that may require a database connection and you still want to make sure -- that you are only using one connection through all of your nested methods. -withPG :: (HasPostgres m) +withPG :: (MonadBaseControl IO m, HasPostgres m) => m b -> m b withPG f = do s <- getPostgresState case s of - (PostgresPool p) -> withResource p (\c -> setLocalPostgresState (PostgresConn c) f) + (PostgresPool p) -> control $ \run -> withResource p (\c -> run $ setLocalPostgresState (PostgresConn c) f) (PostgresConn _) -> f