diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-09-04 14:00:54 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-09-04 14:00:54 -0400 |
commit | 1e06157ead17eb9cb2b59f7bf84cb4da6f10e8bb (patch) | |
tree | a490f0dfda35273fa615a5df2aa1a249c88a0ff1 | |
parent | 5083bca3809b27b6f9faddbefcbdc93b3ccd8226 (diff) |
flush queued changes to export db on exit
-rw-r--r-- | Command/Export.hs | 2 | ||||
-rw-r--r-- | Database/Export.hs | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Command/Export.hs b/Command/Export.hs index 38bda459c..c09253dc9 100644 --- a/Command/Export.hs +++ b/Command/Export.hs @@ -108,6 +108,8 @@ seek o = do seekActions $ pure $ map (startExport r db) l void $ liftIO cleanup' + closeDb db + startExport :: Remote -> ExportHandle -> Git.LsTree.TreeItem -> CommandStart startExport r db ti = do ek <- exportKey (Git.LsTree.sha ti) diff --git a/Database/Export.hs b/Database/Export.hs index bc79af29f..e2986d075 100644 --- a/Database/Export.hs +++ b/Database/Export.hs @@ -30,7 +30,7 @@ import Types.Remote (ExportLocation(..)) import Database.Persist.TH import Database.Esqueleto hiding (Key) -data ExportHandle = ExportHandle H.DbQueue +newtype ExportHandle = ExportHandle H.DbQueue share [mkPersist sqlSettings, mkMigrate "migrateExport"] [persistLowerCase| Exported |