diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-07-31 16:00:13 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-07-31 16:01:54 -0400 |
commit | dbe6b403da47172346b2536b50a379e6d9b76e31 (patch) | |
tree | 2e1db476752b4431578d61c57e1851cd5def2629 /Limit.hs | |
parent | 9a01e2699598ab7affd7c19058bb2a6dad6d3a16 (diff) |
Improve shutdown due to --time-limit, especially for fsck
* Perform a clean shutdown when --time-limit is reached.
This includes running queued git commands, and cleanup actions normally
run when a command is finished.
* fsck: Commit incremental fsck database when --time-limit is reached.
Previously, some of the last files fscked did not make it into the
database when using --time-limit.
Note that this changes Annex.addCleanup hooks, to run after --time-limit
expires. Fsck was using such a hook to clean up after a
--incremental-schedule, and that shouldn't run when --time-limit exipires
it. So, instead, moved that cleanup code to be run by cleanupIncremental.
Resulted in some data type juggling.
Diffstat (limited to 'Limit.hs')
-rw-r--r-- | Limit.hs | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -13,6 +13,7 @@ import qualified Utility.Matcher import qualified Remote import qualified Backend import Annex.Content +import Annex.Action import Annex.UUID import Logs.Trust import Annex.NumCopies @@ -271,6 +272,7 @@ addTimeLimit s = do if now > cutoff then do warning $ "Time limit (" ++ s ++ ") reached!" + shutdown True liftIO $ exitWith $ ExitFailure 101 else return True |