summaryrefslogtreecommitdiff
path: root/Assistant/Threads
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-26 17:45:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-26 17:45:30 -0400
commit347d3892e7b7897f696268a162e8638b12612f31 (patch)
tree39672816dcc6ecb8afc961125d8e2d36671d055c /Assistant/Threads
parentbeaecce68b268898f9d47be9ca36c55a708abc59 (diff)
avoid some confusing alerts
Diffstat (limited to 'Assistant/Threads')
-rw-r--r--Assistant/Threads/TransferScanner.hs12
1 files changed, 8 insertions, 4 deletions
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