From 347d3892e7b7897f696268a162e8638b12612f31 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 26 Aug 2012 17:45:30 -0400 Subject: avoid some confusing alerts --- Assistant/Threads/TransferScanner.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Assistant/Threads/TransferScanner.hs') diff --git a/Assistant/Threads/TransferScanner.hs b/Assistant/Threads/TransferScanner.hs index a76453b53..87af3567e 100644 --- a/Assistant/Threads/TransferScanner.hs +++ b/Assistant/Threads/TransferScanner.hs @@ -15,6 +15,7 @@ import Assistant.DaemonStatus import Assistant.Alert import Logs.Transfer import Logs.Location +import Logs.Web (webUUID) import qualified Remote import qualified Types.Remote as Remote import Utility.ThreadScheduler @@ -98,15 +99,18 @@ failedTransferScan st dstatus transferqueue r = do - - The scan is blocked when the transfer queue gets too large. -} expensiveScan :: ThreadState -> DaemonStatusHandle -> TransferQueue -> [Remote] -> IO () -expensiveScan st dstatus transferqueue rs = do - liftIO $ debug thisThread ["starting scan of", show rs] - void $ alertWhile dstatus (scanAlert rs) $ do +expensiveScan st dstatus transferqueue rs = unless onlyweb $ do + liftIO $ debug thisThread ["starting scan of", show visiblers] + void $ alertWhile dstatus (scanAlert visiblers) $ do g <- runThreadState st $ fromRepo id files <- LsFiles.inRepo [] g go files return True - liftIO $ debug thisThread ["finished scan of", show rs] + liftIO $ debug thisThread ["finished scan of", show visiblers] where + onlyweb = all (== webUUID) $ map Remote.uuid rs + visiblers = let rs' = filter (not . Remote.readonly) rs + in if null rs' then rs else rs' go [] = noop go (f:fs) = do mapM_ (enqueue f) =<< catMaybes <$> runThreadState st -- cgit v1.2.3