diff --git a/keydb_extension.go b/keydb_extension.go index c5af580..af473b8 100644 --- a/keydb_extension.go +++ b/keydb_extension.go @@ -32,14 +32,10 @@ func (KeyDBHandler) CaddyModule() caddy.ModuleInfo { } func (h *KeyDBHandler) Provision(ctx caddy.Context) error { - db, err := strconv.Atoi(h.DB) - if err != nil { - return fmt.Errorf("invalid db value: %v", err) - } h.client = redis.NewClient(&redis.Options{ Addr: h.Address, Password: h.Password, - DB: db, + DB: h.DB, }) return nil } @@ -80,7 +76,7 @@ func (h *KeyDBHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { return d.ArgErr() } case "db": - if !d.Args(&h.DB) { + if !d.Args(strconv.Atoi(&h.DB)) { return d.ArgErr() } }