run full transfer scan on all remotes at startup

Or when a remote first becomes available after startup.
This commit is contained in:
Joey Hess 2012-08-24 13:46:10 -04:00
parent 9fafddc7eb
commit e58d19b533
3 changed files with 39 additions and 17 deletions

View file

@ -41,9 +41,9 @@ getScanRemote v = atomically $ do
return ret
{- Adds new remotes that need scanning to the map. -}
addScanRemotes :: ScanRemoteMap -> [Remote] -> Bool -> IO ()
addScanRemotes _ [] _ = noop
addScanRemotes v rs full = atomically $ do
addScanRemotes :: ScanRemoteMap -> Bool -> [Remote] -> IO ()
addScanRemotes _ _ [] = noop
addScanRemotes v full rs = atomically $ do
m <- fromMaybe M.empty <$> tryTakeTMVar v
putTMVar v $ M.unionWith merge (M.fromList $ zip rs (map info rs)) m
where