Skip to content

Commit de6d0f4

Browse files
authored
Add Backend to configuration (#23)
1 parent a4686e7 commit de6d0f4

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Config struct {
1010
Disabled bool `toml:"disabled"` // default: false
1111

1212
WindowLength time.Duration `toml:"window_length"` // default: 1m
13-
ClientName string `toml:"client_name"` // default: os.Args[0]
13+
ClientName string `toml:"client_name"` // default: ""
1414
PrefixKey string `toml:"prefix_key"` // default: "httprate"
1515

1616
// OnError lets you subscribe to all runtime Redis errors. Useful for logging/debugging.

httprateredis.go

-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package httprateredis
33
import (
44
"context"
55
"fmt"
6-
"os"
7-
"path/filepath"
86
"strconv"
97
"sync/atomic"
108
"time"
@@ -38,9 +36,6 @@ func NewCounter(cfg *Config) *redisCounter {
3836
if cfg.Port < 1 {
3937
cfg.Port = 6379
4038
}
41-
if cfg.ClientName == "" {
42-
cfg.ClientName = filepath.Base(os.Args[0])
43-
}
4439
if cfg.PrefixKey == "" {
4540
cfg.PrefixKey = "httprate"
4641
}

0 commit comments

Comments
 (0)