aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/TransferScanner.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-18 23:05:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-18 23:15:48 -0400
commitb5ca4df9ecf906e6640be362708face2215b5469 (patch)
tree463769f3ede4893622f1a735c50f6c18c163c846 /Assistant/Threads/TransferScanner.hs
parent154b11d6b1900b7104809810bee2d611b2993d42 (diff)
new alert while scanning
Like the old one, but does not mention which remotes are scanned. I think this is less confusing, as it does not imply the remotes were somehow accessed (which they are not; inaccessible remotes can be scanned.)
Diffstat (limited to 'Assistant/Threads/TransferScanner.hs')
-rw-r--r--Assistant/Threads/TransferScanner.hs17
1 files changed, 10 insertions, 7 deletions
diff --git a/Assistant/Threads/TransferScanner.hs b/Assistant/Threads/TransferScanner.hs
index d328ba197..28490e4e4 100644
--- a/Assistant/Threads/TransferScanner.hs
+++ b/Assistant/Threads/TransferScanner.hs
@@ -14,6 +14,7 @@ import Assistant.TransferQueue
import Assistant.DaemonStatus
import Assistant.Drop
import Assistant.Sync
+import Assistant.Alert
import Logs.Transfer
import Logs.Location
import Logs.Web (webUUID)
@@ -38,13 +39,15 @@ transferScannerThread = namedThread "TransferScanner" $ do
go scanned = do
liftIO $ threadDelaySeconds (Seconds 2)
(rs, infos) <- unzip <$> getScanRemote
- if any fullScan infos || any (`S.notMember` scanned) rs
- then do
- expensiveScan rs
- go $ scanned `S.union` S.fromList rs
- else do
- mapM_ failedTransferScan rs
- go scanned
+ void $ alertWhile scanAlert $ do
+ if any fullScan infos || any (`S.notMember` scanned) rs
+ then do
+ expensiveScan rs
+ go $ scanned `S.union` S.fromList rs
+ else do
+ mapM_ failedTransferScan rs
+ go scanned
+ return True
{- All git remotes are synced, and all available remotes
- are scanned in full on startup, for multiple reasons, including:
-