summaryrefslogtreecommitdiffhomepage
path: root/Storage.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-22 10:40:06 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-22 10:44:55 -0400
commit3923667ebdb24680dbb415bd688a8c0326df2212 (patch)
tree81a6648827130f013053994ba6ec65ddb3cfd772 /Storage.hs
parent281bc63549a49c173b85d7b80b4b703aab9d3a52 (diff)
downloadkeysafe-3923667ebdb24680dbb415bd688a8c0326df2212.tar.gz
allow servers to have multiple or no addresses
This allows the server list to contain 3 servers although only 1 is running so far; uploads to the others will be queued. It also allows a server to be spread amoung multiple addresses, which may be useful later for scaling. This changes BackupRecord serialization, but it's not been in a keysafe release yet, so that's not a problem. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
Diffstat (limited to 'Storage.hs')
-rw-r--r--Storage.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Storage.hs b/Storage.hs
index ded4bbf..3e2c418 100644
--- a/Storage.hs
+++ b/Storage.hs
@@ -148,7 +148,8 @@ storeChaff hn port = forever $ do
mapConcurrently (go sis rng')
[1..totalObjects (shareParams testModeTunables)]
where
- server = networkStorage Nothing $ Server hn port
+ server = networkStorage Nothing $ Server (ServerName hn)
+ [ServerAddress hn port]
objsize = objectSize defaultTunables * shareOverhead defaultTunables
go sis rng n = do
let (b, rng') = cprgGenerate objsize rng