From 69bd7240003d92e2cf839926dc1bcd219b48559e Mon Sep 17 00:00:00 2001 From: Nixon Date: Tue, 13 Aug 2024 14:24:34 -0700 Subject: [PATCH] new --- keydb_extension.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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() } }