summaryrefslogtreecommitdiffhomepage
path: root/Storage.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-10-06 14:38:59 -0400
committerJoey Hess <joeyh@joeyh.name>2016-10-06 14:49:24 -0400
commit61ab8bd1f576e633a2eea4b63033c368a6645602 (patch)
tree1eacccce62019f89360a605d2c0cac72993bfa65 /Storage.hs
parentb40d441c52f37584653e74fada9906cc8105c9f7 (diff)
downloadkeysafe-61ab8bd1f576e633a2eea4b63033c368a6645602.tar.gz
New --add-storage-directory and --add-server options
* New --add-storage-directory and --add-server options, which can be used to make keysafe backup/restore using additional locations. * Removed --store-local option; use --add-storage-directory instead. This commit was sponsored by Thomas Hochstein on Patreon.
Diffstat (limited to 'Storage.hs')
-rw-r--r--Storage.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Storage.hs b/Storage.hs
index de6eab3..428dc6f 100644
--- a/Storage.hs
+++ b/Storage.hs
@@ -25,12 +25,10 @@ import System.Random
import Control.Concurrent.Thread.Delay
import Control.Concurrent.Async
import qualified Data.Set as S
-import Network.Wai.Handler.Warp (Port)
import System.Random.Shuffle
-networkStorageLocations :: Maybe LocalStorageDirectory -> IO StorageLocations
-networkStorageLocations = shuffleStorageLocations
- . StorageLocations . serverList
+networkStorageLocations :: Maybe LocalStorageDirectory -> StorageLocations
+networkStorageLocations = StorageLocations . serverList
type UpdateProgress = IO ()
@@ -155,7 +153,8 @@ retrieveShares (StorageLocations locs) sis updateprogress = do
-- | Returns descriptions of any failures.
tryUploadQueued :: Maybe LocalStorageDirectory -> IO [String]
tryUploadQueued d = do
- StorageLocations locs <- networkStorageLocations d
+ StorageLocations locs <- shuffleStorageLocations $
+ networkStorageLocations d
results <- forM locs $ \loc -> case uploadQueue loc of
Nothing -> return []
Just q -> moveShares q loc