From 58de8bf3927d07649cf04e9ca2381760b907a6a6 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 11 Jun 2017 13:46:54 +0200 Subject: [PATCH] swift/rest: Reduce number of connections --- src/restic/backend/location/location_test.go | 6 +++--- src/restic/backend/rest/config.go | 4 ++-- src/restic/backend/rest/config_test.go | 2 +- src/restic/backend/swift/config.go | 4 ++-- src/restic/backend/swift/config_test.go | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/restic/backend/location/location_test.go b/src/restic/backend/location/location_test.go index 0f07bf412..4aaa440cd 100644 --- a/src/restic/backend/location/location_test.go +++ b/src/restic/backend/location/location_test.go @@ -211,7 +211,7 @@ var parseTests = []struct { Config: swift.Config{ Container: "container17", Prefix: "", - Connections: 20, + Connections: 5, }, }, }, @@ -221,7 +221,7 @@ var parseTests = []struct { Config: swift.Config{ Container: "container17", Prefix: "prefix97", - Connections: 20, + Connections: 5, }, }, }, @@ -230,7 +230,7 @@ var parseTests = []struct { Location{Scheme: "rest", Config: rest.Config{ URL: parseURL("http://hostname.foo:1234/"), - Connections: 20, + Connections: 5, }, }, }, diff --git a/src/restic/backend/rest/config.go b/src/restic/backend/rest/config.go index e1ad4e726..f696d17de 100644 --- a/src/restic/backend/rest/config.go +++ b/src/restic/backend/rest/config.go @@ -11,7 +11,7 @@ import ( // Config contains all configuration necessary to connect to a REST server. type Config struct { URL *url.URL - Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 20)"` + Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"` } func init() { @@ -21,7 +21,7 @@ func init() { // NewConfig returns a new Config with the default values filled in. func NewConfig() Config { return Config{ - Connections: 20, + Connections: 5, } } diff --git a/src/restic/backend/rest/config_test.go b/src/restic/backend/rest/config_test.go index 0f27d1c09..ed5413323 100644 --- a/src/restic/backend/rest/config_test.go +++ b/src/restic/backend/rest/config_test.go @@ -21,7 +21,7 @@ var configTests = []struct { }{ {"rest:http://localhost:1234", Config{ URL: parseURL("http://localhost:1234"), - Connections: 20, + Connections: 5, }}, } diff --git a/src/restic/backend/swift/config.go b/src/restic/backend/swift/config.go index 6ef2d4d6f..255c28fd8 100644 --- a/src/restic/backend/swift/config.go +++ b/src/restic/backend/swift/config.go @@ -26,7 +26,7 @@ type Config struct { Prefix string DefaultContainerPolicy string - Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 20)"` + Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"` } func init() { @@ -36,7 +36,7 @@ func init() { // NewConfig returns a new config with the default values filled in. func NewConfig() Config { return Config{ - Connections: 20, + Connections: 5, } } diff --git a/src/restic/backend/swift/config_test.go b/src/restic/backend/swift/config_test.go index 2c1f4c4aa..35f091a9b 100644 --- a/src/restic/backend/swift/config_test.go +++ b/src/restic/backend/swift/config_test.go @@ -11,21 +11,21 @@ var configTests = []struct { Config{ Container: "cnt1", Prefix: "", - Connections: 20, + Connections: 5, }, }, { "swift:cnt2:/prefix", Config{Container: "cnt2", Prefix: "prefix", - Connections: 20, + Connections: 5, }, }, { "swift:cnt3:/prefix/longer", Config{Container: "cnt3", Prefix: "prefix/longer", - Connections: 20, + Connections: 5, }, }, }