stash DbHandle in Annex state

This commit is contained in:
Joey Hess 2015-12-09 14:55:47 -04:00
parent 78a6b8ce05
commit 05b598a057
Failed to extract signature
5 changed files with 46 additions and 14 deletions

View file

@ -21,7 +21,6 @@ module Database.Handle (
import Utility.Exception
import Utility.Monad
import Messages
import Database.Persist.Sqlite
import qualified Database.Sqlite as Sqlite
@ -35,6 +34,7 @@ import Control.Monad.Trans.Resource (runResourceT)
import Control.Monad.Logger (runNoLoggingT)
import Data.List
import Data.Time.Clock
import System.IO
{- A DbHandle is a reference to a worker thread that communicates with
- the database. It has a MVar which Jobs are submitted to. -}
@ -79,7 +79,7 @@ type TableName = String
workerThread :: T.Text -> TableName -> MVar Job -> IO ()
workerThread db tablename jobs = catchNonAsync (run loop) showerr
where
showerr e = liftIO $ warningIO $
showerr e = liftIO $ hPutStrLn stderr $
"sqlite worker thread crashed: " ++ show e
loop = do