Implement rate limiting option, fixes #71
This commit is contained in:
10
cmd/cmd.go
10
cmd/cmd.go
@ -95,6 +95,12 @@ var globalFlags = []cli.Flag{
|
||||
Value: "",
|
||||
EnvVar: "BUCKET",
|
||||
},
|
||||
cli.IntFlag{
|
||||
Name: "rate-limit",
|
||||
Usage: "requests per minute",
|
||||
Value: 0,
|
||||
EnvVar: "",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "lets-encrypt-hosts",
|
||||
Usage: "host1, host2",
|
||||
@ -190,6 +196,10 @@ func New() *Cmd {
|
||||
options = append(options, server.ClamavHost(v))
|
||||
}
|
||||
|
||||
if v := c.Int("rate-limit"); v > 0 {
|
||||
options = append(options, server.RateLimit(v))
|
||||
}
|
||||
|
||||
if cert := c.String("tls-cert-file"); cert == "" {
|
||||
} else if pk := c.String("tls-private-key"); pk == "" {
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user