This commit is contained in:
Nixon 2024-08-13 14:24:34 -07:00
parent c3dd546952
commit 69bd724000
No known key found for this signature in database

View file

@ -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()
}
}