diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-02-16 16:04:23 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-02-16 16:07:36 -0400 |
commit | e25ea03e118a76ef59169ec6fb5b195c80ff00f7 (patch) | |
tree | 8b284ba4c4e4b8c907d3508725a418b8cdcda915 /Command | |
parent | 28e6e6f71d6c7c64225cbfa65dcdf5db8c8e22e8 (diff) |
commit more transactions when fscking
This makes interrupt and resume work, robustly.
But, incremental fsck is slowed down by all those transactions..
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Fsck.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 4890b33bd..59d07caf4 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -434,7 +434,7 @@ runFsck inc file key a = ifM (needFsck inc key) {- Check if a key needs to be fscked, with support for incremental fscks. -} needFsck :: Incremental -> Key -> Annex Bool -needFsck (ContIncremental h) key = not <$> FsckDb.inDb h key +needFsck (ContIncremental h) key = liftIO $ not <$> FsckDb.inDb h key needFsck _ _ = return True withFsckDb :: Incremental -> (FsckDb.DbHandle -> Annex ()) -> Annex () @@ -443,7 +443,9 @@ withFsckDb (StartIncremental h) a = a h withFsckDb NonIncremental _ = noop recordFsckTime :: Incremental -> Key -> Annex () -recordFsckTime inc key = withFsckDb inc $ \h -> FsckDb.addDb h key +recordFsckTime inc key = withFsckDb inc $ \h -> liftIO $ do + FsckDb.addDb h key + FsckDb.commitDb h {- Records the start time of an incremental fsck. - |