flush queued changes to export db on exit

This commit is contained in:
Joey Hess 2017-09-04 14:00:54 -04:00
parent 42eaa340fe
commit 2c90ed1fea
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 3 additions and 1 deletions

View file

@ -108,6 +108,8 @@ seek o = do
seekActions $ pure $ map (startExport r db) l seekActions $ pure $ map (startExport r db) l
void $ liftIO cleanup' void $ liftIO cleanup'
closeDb db
startExport :: Remote -> ExportHandle -> Git.LsTree.TreeItem -> CommandStart startExport :: Remote -> ExportHandle -> Git.LsTree.TreeItem -> CommandStart
startExport r db ti = do startExport r db ti = do
ek <- exportKey (Git.LsTree.sha ti) ek <- exportKey (Git.LsTree.sha ti)

View file

@ -30,7 +30,7 @@ import Types.Remote (ExportLocation(..))
import Database.Persist.TH import Database.Persist.TH
import Database.Esqueleto hiding (Key) import Database.Esqueleto hiding (Key)
data ExportHandle = ExportHandle H.DbQueue newtype ExportHandle = ExportHandle H.DbQueue
share [mkPersist sqlSettings, mkMigrate "migrateExport"] [persistLowerCase| share [mkPersist sqlSettings, mkMigrate "migrateExport"] [persistLowerCase|
Exported Exported