Skip to content

Commit

Permalink
Merge pull request #50 from Icinga/redis-db-config
Browse files Browse the repository at this point in the history
redis: Configurable Database
  • Loading branch information
julianbrost authored Aug 2, 2024
2 parents ee07796 + 7d47808 commit 64c2bc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion redis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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 redis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Config struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Password string `yaml:"password"`
Database int `yaml:"database" default:"0"`
TlsOptions config.TLS `yaml:",inline"`
Options Options `yaml:"options"`
}
Expand Down

0 comments on commit 64c2bc4

Please sign in to comment.