summaryrefslogtreecommitdiffhomepage
path: root/Storage
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
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')
-rw-r--r--Storage/Network.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Storage/Network.hs b/Storage/Network.hs
index dec6d57..f8169c9 100644
--- a/Storage/Network.hs
+++ b/Storage/Network.hs
@@ -25,9 +25,11 @@ networkStorage localdir server = Storage
, countShares = count server
, moveShares = move server
, uploadQueue = Just $ localStorage (storageDir localdir)
- ("uploadqueue" </> serverName server)
+ ("uploadqueue" </> name)
, getServer = Just server
}
+ where
+ ServerName name = serverName server
store :: Server -> StorableObjectIdent -> Share -> IO StoreResult
store srv i (Share _n o) =