diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-10 21:55:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-10 21:55:59 -0400 |
commit | d19bbd29d8f473eae1aa1fa76c22e5374922c108 (patch) | |
tree | ffb8391884b271a822f1e031d1051219093b267a /Assistant/Sync.hs | |
parent | a41255723c55d0046e8a9953a7ebaef9d2196bb5 (diff) |
pairing probably works now (untested)
Diffstat (limited to 'Assistant/Sync.hs')
-rw-r--r-- | Assistant/Sync.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs index 42863f858..4a9cae767 100644 --- a/Assistant/Sync.hs +++ b/Assistant/Sync.hs @@ -24,6 +24,7 @@ import qualified Annex.Branch import Data.Time.Clock import qualified Data.Map as M +import Control.Concurrent {- Syncs with remotes that may have been disconnected for a while. - @@ -108,3 +109,9 @@ manualPull st currentbranch remotes = do forM_ remotes $ \r -> runThreadState st $ Command.Sync.mergeRemote r currentbranch return haddiverged + +{- Start syncing a newly added remote, using a background thread. -} +syncNewRemote :: ThreadState -> DaemonStatusHandle -> ScanRemoteMap -> Remote -> IO () +syncNewRemote st dstatus scanremotes remote = do + runThreadState st $ updateKnownRemotes dstatus + void $ forkIO $ do reconnectRemotes "SyncRemote" st dstatus scanremotes [remote] |