summaryrefslogtreecommitdiff
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
parent33142d02b0652c9f23e12bd205b62cf3d72b3659 (diff)
assistant: Sync with all git remotes on startup.
-rw-r--r--Assistant/Threads/TransferScanner.hs12
-rw-r--r--debian/changelog1
-rw-r--r--doc/design/assistant/xmpp.mdwn5
3 files changed, 10 insertions, 8 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 ()
diff --git a/debian/changelog b/debian/changelog
index bf6016f76..6ca99c62e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,7 @@ git-annex (4.20130228) UNRELEASED; urgency=low
* Bugfix: git annex add, when ran without any file or directory specified,
should add files in the current directory, but not act on unlocked files
elsewhere in the tree.
+ * assistant: Sync with all git remotes on startup.
-- Joey Hess <joeyh@debian.org> Wed, 27 Feb 2013 23:20:40 -0400
diff --git a/doc/design/assistant/xmpp.mdwn b/doc/design/assistant/xmpp.mdwn
index 4b317fb9a..fed79527e 100644
--- a/doc/design/assistant/xmpp.mdwn
+++ b/doc/design/assistant/xmpp.mdwn
@@ -14,11 +14,6 @@ who share a repository, that is stored in the [[cloud]].
push notification use of XMPP, since unknown UUIDs will just be ignored.
But XMPP pairing and the pushes over XMPP assume that anyone you're
paired with is intending to sync to your repository.
-* Disconnect network, make change, stop assistant, reconnect network,
- start assistant. Change is not propigated. Seems nothing handles
- calling reconnectRemotes on startup. (If the change gets committed during
- startup, it does get synced out, by other means.) This is probably not
- xmpp specific really.
## design goals