Skip to content

Commit

Permalink
Add pkg/redis#Config.Database
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Oct 9, 2023
1 parent e5ec6a3 commit cf29246
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/redis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func NewClientFromConfig(c *Config, logger *logging.Logger) (*Client, error) {
options := &redis.Options{
Dialer: dialWithLogging(dialer, logger),
Password: c.Password,
DB: 0, // Use default DB,
DB: c.Database,
ReadTimeout: c.Options.Timeout,
TLSConfig: tlsConfig,
}
Expand Down
1 change: 1 addition & 0 deletions pkg/redis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
type Config struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Database int `yaml:"database" default:"0"`
Password string `yaml:"password"`
TlsOptions config.TLS `yaml:",inline"`
Options Options `yaml:"options"`
Expand Down

0 comments on commit cf29246

Please sign in to comment.