summaryrefslogtreecommitdiff
path: root/Assistant/Threads/TransferScanner.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-29 13:22:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-29 13:22:08 -0400
commit09e77a0cf0ca6e6c76ead584f16818dcf04a94b6 (patch)
tree7750b4b7e48cfe8c3c121e43edb9a3318ea104dd /Assistant/Threads/TransferScanner.hs
parent2dc5697a0ac36fdfe21da79a721db3f086bce041 (diff)
add some alerts
Diffstat (limited to 'Assistant/Threads/TransferScanner.hs')
-rw-r--r--Assistant/Threads/TransferScanner.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/Assistant/Threads/TransferScanner.hs b/Assistant/Threads/TransferScanner.hs
index e6a078907..1bf8b062f 100644
--- a/Assistant/Threads/TransferScanner.hs
+++ b/Assistant/Threads/TransferScanner.hs
@@ -12,6 +12,7 @@ import Assistant.ScanRemotes
import Assistant.TransferQueue
import Assistant.ThreadedMonad
import Assistant.DaemonStatus
+import Assistant.Alert
import Logs.Transfer
import Logs.Location
import qualified Remote
@@ -31,9 +32,18 @@ transferScannerThread st dstatus scanremotes transferqueue = do
runEvery (Seconds 2) $ do
r <- getScanRemote scanremotes
liftIO $ debug thisThread ["starting scan of", show r]
- scan st dstatus transferqueue r
+ alertWhile dstatus (scanalert r) $
+ scan st dstatus transferqueue r
liftIO $ debug thisThread ["finished scan of", show r]
where
+ scanalert r = Alert
+ { alertClass = Activity
+ , alertHeader = Just $ "Scanning " ++ Remote.name r
+ , alertMessage = StringAlert $ unwords
+ [ "Ensuring that ", Remote.name r
+ , "is fully in sync." ]
+ , alertBlockDisplay = True
+ }
{- This is a naive scan through the git work tree.
-