Fix build with persistent-2.12.0.1

persistent stopped using askLogFunc, and the thing to use is askLoggerIO
from monad-logger. Bumped the dep to the first version that contained that.

Note that the i386ancient build uses a newer monad-logger than 0.3.10,
so the new versioned dep should not break it, and presumably nothing else
either.

This commit was sponsored by Noam Kremen on Patreon.
This commit is contained in:
Joey Hess 2021-04-01 12:19:47 -04:00
parent 4dde355c79
commit 8868a3a4c7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 26 additions and 4 deletions

View file

@ -26,7 +26,7 @@ import qualified Database.Sqlite as Sqlite
import Control.Monad
import Control.Monad.IO.Class (liftIO)
import Control.Monad.IO.Unlift (MonadUnliftIO, withRunInIO)
import Control.Monad.Logger (MonadLogger)
import Control.Monad.Logger (MonadLoggerIO, askLoggerIO)
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception (throwIO, BlockedIndefinitelyOnMVar(..))
@ -245,7 +245,7 @@ runSqliteRobustly tablename db a = do
-- Like withSqlConn, but more robust.
withSqlConnRobustly
:: (MonadUnliftIO m
, MonadLogger m
, MonadLoggerIO m
, IsPersistBackend backend
, BaseBackend backend ~ SqlBackend
, BackendCompatible SqlBackend backend
@ -254,7 +254,7 @@ withSqlConnRobustly
-> (backend -> m a)
-> m a
withSqlConnRobustly open f = do
logFunc <- askLogFunc
logFunc <- askLoggerIO
withRunInIO $ \run -> bracket
(open logFunc)
closeRobustly