From 3eb522469e641e31d02fa060a1b48b93edbf7d84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Sep 2016 14:08:36 -0400 Subject: record already-existing backup in log after restoring a secret key This will prevent --autostart from prompting to get the newly restored key backed up again. This commit was sponsored by Remy van Elst on Patreon. --- Storage.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Storage.hs') diff --git a/Storage.hs b/Storage.hs index aa52d7c..fcd2f7e 100644 --- a/Storage.hs +++ b/Storage.hs @@ -90,13 +90,14 @@ storeShares (StorageLocations locs) allsis shares updateprogress = do -- Assumes that each location only contains one share. So, once a -- share has been found on a location, can avoid asking that location -- for any other shares. -retrieveShares :: StorageLocations -> ShareIdents -> UpdateProgress -> IO (S.Set Share, ShareIdents) +retrieveShares :: StorageLocations -> ShareIdents -> UpdateProgress -> IO (S.Set Share, ShareIdents, [Server]) retrieveShares (StorageLocations locs) sis updateprogress = do let (is, sis') = nextShareIdents sis let want = zip [1..] (S.toList is) (shares, usedlocs, _unusedlocs) <- go locs [] want [] _ <- mapM_ obscureShares usedlocs - return (S.fromList shares, sis') + let usedservers = mapMaybe getServer usedlocs + return (S.fromList shares, sis', usedservers) where go unusedlocs usedlocs [] shares = return (shares, usedlocs, unusedlocs) go [] usedlocs _ shares = return (shares, usedlocs, []) -- cgit v1.2.3