aboutsummaryrefslogtreecommitdiff
path: root/Database
diff options
context:
space:
mode:
Diffstat (limited to 'Database')
-rw-r--r--Database/Handle.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Database/Handle.hs b/Database/Handle.hs
index 5c4fcca38..691902a80 100644
--- a/Database/Handle.hs
+++ b/Database/Handle.hs
@@ -16,6 +16,7 @@ module Database.Handle (
) where
import Utility.Exception
+import Messages
import Database.Persist.Sqlite (runSqlite)
import Database.Esqueleto hiding (Key)
@@ -41,8 +42,9 @@ openDb db = do
return $ DbHandle worker jobs t
workerThread :: T.Text -> MVar Job -> IO ()
-workerThread db jobs = go
+workerThread db jobs = catchNonAsync go showerr
where
+ showerr e = liftIO $ warningIO $ "sqlite worker thread crashed: " ++ show e
go = do
r <- runSqlite db transaction
case r of