From 110c8f7b8e1fa484752298de5b48ea50b195066a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Oct 2013 17:27:00 -0400 Subject: queue downloads of keys that fsck finds with bad content --- Assistant/Threads/Cronner.hs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Assistant') 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, -- cgit v1.2.3