summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Cronner.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-10 17:27:00 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-10 17:27:00 -0400
commit110c8f7b8e1fa484752298de5b48ea50b195066a (patch)
tree2bf785e8dc21b4b23046188d194431445a41e77f /Assistant/Threads/Cronner.hs
parent3a48563e5258f650e6da41a90d2140bf033ce58f (diff)
queue downloads of keys that fsck finds with bad content
Diffstat (limited to 'Assistant/Threads/Cronner.hs')
-rw-r--r--Assistant/Threads/Cronner.hs15
1 files changed, 12 insertions, 3 deletions
diff --git a/Assistant/Threads/Cronner.hs b/Assistant/Threads/Cronner.hs
index 78b6a480c..1a27e3c1b 100644
--- a/Assistant/Threads/Cronner.hs
+++ b/Assistant/Threads/Cronner.hs
@@ -22,6 +22,9 @@ import Types.ScheduledActivity
import Utility.ThreadScheduler
import Utility.HumanTime
import qualified Build.SysConfig
+import Assistant.TransferQueue
+import Annex.Content
+import Logs.Transfer
import Control.Concurrent.Async
import Data.Time.LocalTime
@@ -123,13 +126,19 @@ secondsUntilLocalTime t = do
else Seconds 0
runActivity :: ScheduledActivity -> Assistant ()
-runActivity (ScheduledSelfFsck _ d) = liftIO $ do
- program <- readProgramFile
- void $ niceShell $
+runActivity (ScheduledSelfFsck _ d) = do
+ program <- liftIO $ readProgramFile
+ void $ liftIO $ niceShell $
program ++ " fsck --incremental-schedule=1d --time-limit=" ++ fromDuration d
+ queueBad
runActivity (ScheduledRemoteFsck _ _ _) =
debug ["remote fsck not implemented yet"]
+queueBad :: Assistant ()
+queueBad = mapM_ queue =<< liftAnnex (dirKeys gitAnnexBadDir)
+ where
+ queue k = queueTransfers "fsck found bad file; redownloading" Next k Nothing Download
+
{- Runs a shell command niced, until it terminates.
-
- When an async exception is received, the command is sent a SIGTERM,