-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add db connection configuration #254
Conversation
value to error
Pull Request Test Coverage Report for Build 2838249550
💛 - Coveralls |
d014250
to
6b4d7ba
Compare
@@ -41,6 +41,15 @@ func NewStore(c *store.Config) (*Store, error) { | |||
log.Panic(err) | |||
} | |||
|
|||
db, err := gormDB.DB() | |||
if err != nil { | |||
log.Panic(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Panic(err) | |
return nil, err |
@singhvikash11 these changes are present in the latest version of salt. Can we bump up the salt version and use that? |
SslMode string `mapstructure:"sslmode" default:"disable"` | ||
MaxIdleConns int `yaml:"max_idle_conns" mapstructure:"max_idle_conns" default:"3"` | ||
MaxOpenConns int `yaml:"max_open_conns" mapstructure:"max_open_conns" default:"10"` | ||
ConnMaxLifeTime time.Duration `yaml:"conn_max_life_time" mapstructure:"conn_max_life_time" default:"10ms"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the clarity better to add the unit itself.
ConnMaxLifeTime time.Duration `yaml:"conn_max_life_time" mapstructure:"conn_max_life_time" default:"10ms"` | |
ConnMaxLifeTimeMS time.Duration `yaml:"conn_max_life_time_ms" mapstructure:"conn_max_life_time" default:"10ms"` |
@@ -1,12 +1,18 @@ | |||
package store | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are moving from gorm and I think we suppose to use salt/db
@singhvikash11 +1, we plan to remove Gorm. So salt/db package will be used for this. If any of the missing setting is not there then lets raise PR for that in salt. |
Address connection setting