swift/rest: Reduce number of connections

This commit is contained in:
Alexander Neumann 2017-06-11 13:46:54 +02:00
parent a89a7a783a
commit 58de8bf392
5 changed files with 11 additions and 11 deletions

View File

@ -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,
},
},
},

View File

@ -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,
}
}

View File

@ -21,7 +21,7 @@ var configTests = []struct {
}{
{"rest:http://localhost:1234", Config{
URL: parseURL("http://localhost:1234"),
Connections: 20,
Connections: 5,
}},
}

View File

@ -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,
}
}

View File

@ -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,
},
},
}