2015-07-31 20:00:13 +00:00
|
|
|
{- git-annex actions
|
|
|
|
-
|
|
|
|
- Copyright 2010-2015 Joey Hess <id@joeyh.name>
|
|
|
|
-
|
2019-03-13 19:48:14 +00:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2015-07-31 20:00:13 +00:00
|
|
|
-}
|
|
|
|
|
2019-06-19 16:35:08 +00:00
|
|
|
module Annex.Action (
|
|
|
|
startup,
|
|
|
|
shutdown,
|
|
|
|
stopCoProcesses,
|
|
|
|
) where
|
2015-07-31 20:00:13 +00:00
|
|
|
|
|
|
|
import qualified Data.Map as M
|
|
|
|
|
2016-01-20 20:36:33 +00:00
|
|
|
import Annex.Common
|
2015-07-31 20:00:13 +00:00
|
|
|
import qualified Annex
|
|
|
|
import Annex.Content
|
2020-04-17 18:36:45 +00:00
|
|
|
import Annex.CatFile
|
|
|
|
import Annex.CheckAttr
|
|
|
|
import Annex.HashObject
|
|
|
|
import Annex.CheckIgnore
|
2015-07-31 20:00:13 +00:00
|
|
|
|
|
|
|
{- Actions to perform each time ran. -}
|
|
|
|
startup :: Annex ()
|
2019-01-21 21:21:02 +00:00
|
|
|
startup = return ()
|
2015-07-31 20:00:13 +00:00
|
|
|
|
|
|
|
{- Cleanup actions. -}
|
|
|
|
shutdown :: Bool -> Annex ()
|
|
|
|
shutdown nocommit = do
|
|
|
|
saveState nocommit
|
|
|
|
sequence_ =<< M.elems <$> Annex.getState Annex.cleanup
|
2017-09-30 02:36:08 +00:00
|
|
|
stopCoProcesses
|
|
|
|
|
2020-04-17 18:36:45 +00:00
|
|
|
{- Stops all long-running git query processes. -}
|
|
|
|
stopCoProcesses :: Annex ()
|
|
|
|
stopCoProcesses = do
|
|
|
|
catFileStop
|
|
|
|
checkAttrStop
|
|
|
|
hashObjectStop
|
|
|
|
checkIgnoreStop
|