Fix build with persistent-2.10.

Added an additional constraint that persistent needs.
This also builds with persistent-2.9.2 without needing any cpp.
This commit is contained in:
Joey Hess 2019-10-17 11:58:31 -04:00
parent d0d416b215
commit 904b175707
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 43 additions and 6 deletions

View file

@ -244,10 +244,15 @@ runSqliteRobustly tablename db a = do
-- Like withSqlConn, but more robust.
withSqlConnRobustly
:: (MonadUnliftIO m, MonadLogger m, IsPersistBackend backend, BaseBackend backend ~ SqlBackend)
=> (LogFunc -> IO backend)
-> (backend -> m a)
-> m a
:: (MonadUnliftIO m
, MonadLogger m
, IsPersistBackend backend
, BaseBackend backend ~ SqlBackend
, BackendCompatible SqlBackend backend
)
=> (LogFunc -> IO backend)
-> (backend -> m a)
-> m a
withSqlConnRobustly open f = do
logFunc <- askLogFunc
withRunInIO $ \run -> bracket
@ -258,8 +263,11 @@ withSqlConnRobustly open f = do
-- Sqlite can throw ErrorBusy while closing a database; this catches
-- the exception and retries.
closeRobustly
:: (IsPersistBackend backend, BaseBackend backend ~ SqlBackend)
=> backend
:: (IsPersistBackend backend
, BaseBackend backend ~ SqlBackend
, BackendCompatible SqlBackend backend
)
=> backend
-> IO ()
closeRobustly conn = go maxretries briefdelay
where