only sync with local repos that are currently available (and only fsck them too)
This commit is contained in:
parent
a6e9386d39
commit
5e891672e5
1 changed files with 10 additions and 4 deletions
|
@ -51,10 +51,12 @@ import Control.Concurrent
|
||||||
reconnectRemotes :: Bool -> [Remote] -> Assistant ()
|
reconnectRemotes :: Bool -> [Remote] -> Assistant ()
|
||||||
reconnectRemotes _ [] = noop
|
reconnectRemotes _ [] = noop
|
||||||
reconnectRemotes notifypushes rs = void $ do
|
reconnectRemotes notifypushes rs = void $ do
|
||||||
modifyDaemonStatus_ $ \s -> s
|
rs' <- filterM (checkavailable . Remote.repo) rs
|
||||||
{ desynced = S.union (S.fromList $ map Remote.uuid xmppremotes) (desynced s) }
|
unless (null rs') $ do
|
||||||
void $ syncAction rs (const go)
|
modifyDaemonStatus_ $ \s -> s
|
||||||
mapM_ signal rs
|
{ desynced = S.union (S.fromList $ map Remote.uuid xmppremotes) (desynced s) }
|
||||||
|
failedrs <- syncAction rs' (const go)
|
||||||
|
mapM_ signal $ filter (`notElem` failedrs) rs'
|
||||||
where
|
where
|
||||||
gitremotes = filter (notspecialremote . Remote.repo) rs
|
gitremotes = filter (notspecialremote . Remote.repo) rs
|
||||||
(xmppremotes, nonxmppremotes) = partition isXMPPRemote rs
|
(xmppremotes, nonxmppremotes) = partition isXMPPRemote rs
|
||||||
|
@ -80,6 +82,10 @@ reconnectRemotes notifypushes rs = void $ do
|
||||||
signal r = liftIO . mapM_ (flip tryPutMVar ())
|
signal r = liftIO . mapM_ (flip tryPutMVar ())
|
||||||
=<< fromMaybe [] . M.lookup (Remote.uuid r) . connectRemoteNotifiers
|
=<< fromMaybe [] . M.lookup (Remote.uuid r) . connectRemoteNotifiers
|
||||||
<$> getDaemonStatus
|
<$> getDaemonStatus
|
||||||
|
checkavailable r
|
||||||
|
| Git.repoIsLocal r || Git.repoIsLocalUnknown r =
|
||||||
|
liftIO $ doesDirectoryExist $ Git.repoPath r
|
||||||
|
| otherwise = return True
|
||||||
|
|
||||||
{- Updates the local sync branch, then pushes it to all remotes, in
|
{- Updates the local sync branch, then pushes it to all remotes, in
|
||||||
- parallel, along with the git-annex branch. This is the same
|
- parallel, along with the git-annex branch. This is the same
|
||||||
|
|
Loading…
Reference in a new issue