Add rate limiter instead of connection limit for now

This commit is contained in:
Harshavardhana
2015-06-06 17:01:39 -07:00
parent 996c1a5c28
commit 371651bde6
7 changed files with 86 additions and 74 deletions
+7 -7
View File
@@ -46,9 +46,9 @@ var flags = []cli.Flag{
},
*/
cli.IntFlag{
Name: "conn-limit",
Name: "ratelimit",
Value: 16,
Usage: "Set per IP connection limit quota for server: [DEFAULT: 16]",
Usage: "Limit for total concurrent requests: [DEFAULT: 16]",
},
cli.StringFlag{
Name: "cert",
@@ -84,11 +84,11 @@ func getAPIServerConfig(c *cli.Context) httpserver.Config {
}
tls := (certFile != "" && keyFile != "")
return httpserver.Config{
Address: c.GlobalString("address"),
TLS: tls,
CertFile: certFile,
KeyFile: keyFile,
ConnectionLimit: c.GlobalInt("conn-limit"),
Address: c.GlobalString("address"),
TLS: tls,
CertFile: certFile,
KeyFile: keyFile,
RateLimit: c.GlobalInt("ratelimit"),
}
}