aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/TransferScanner.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-08 13:44:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-08 13:48:27 -0400
commit4a1e053ced6b3eb13625b2ef5422015cb05606ed (patch)
tree4f2c7f0ca9269d7411f5462784d7faff009f3589 /Assistant/Threads/TransferScanner.hs
parent33142d02b0652c9f23e12bd205b62cf3d72b3659 (diff)
assistant: Sync with all git remotes on startup.
Diffstat (limited to 'Assistant/Threads/TransferScanner.hs')
-rw-r--r--Assistant/Threads/TransferScanner.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Assistant/Threads/TransferScanner.hs b/Assistant/Threads/TransferScanner.hs
index c6bb8c586..d4ccf411a 100644
--- a/Assistant/Threads/TransferScanner.hs
+++ b/Assistant/Threads/TransferScanner.hs
@@ -14,6 +14,7 @@ import Assistant.TransferQueue
import Assistant.DaemonStatus
import Assistant.Alert
import Assistant.Drop
+import Assistant.Sync
import Logs.Transfer
import Logs.Location
import Logs.Web (webUUID)
@@ -45,11 +46,14 @@ transferScannerThread = namedThread "TransferScanner" $ do
else do
mapM_ failedTransferScan rs
go scanned
- {- All available remotes are scanned in full on startup,
- - for multiple reasons, including:
+ {- All git remotes are synced, and all available remotes
+ - are scanned in full on startup, for multiple reasons, including:
-
- * This may be the first run, and there may be remotes
- already in place, that need to be synced.
+ - * Changes may have been made last time we run, but remotes were
+ - not available to be synced with.
+ - * Changes may have been made to remotes while we were down.
- * We may have run before, and scanned a remote, but
- only been in a subdirectory of the git remote, and so
- not synced it all.
@@ -57,7 +61,9 @@ transferScannerThread = namedThread "TransferScanner" $ do
- and then the system (or us) crashed, and that info was
- lost.
-}
- startupScan = addScanRemotes True =<< syncDataRemotes <$> getDaemonStatus
+ startupScan = do
+ reconnectRemotes True =<< syncGitRemotes <$> getDaemonStatus
+ addScanRemotes True =<< syncDataRemotes <$> getDaemonStatus
{- This is a cheap scan for failed transfers involving a remote. -}
failedTransferScan :: Remote -> Assistant ()