File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ database: # database
1313 password : root # database password [DATABASE__PASSWORD]
1414 database : sms # database name [DATABASE__DATABASE]
1515 timezone : UTC # database timezone (important for message TTL calculation) [DATABASE__TIMEZONE]
16+ max_open_conns : 4 # database max open connections (default: 4 * CPU) [DATABASE__MAX_OPEN_CONNS]
17+ max_idle_conns : 2 # database max idle connections (default: 2 * CPU) [DATABASE__MAX_IDLE_CONNS]
1618fcm : # firebase cloud messaging config
1719 credentials_json : " {}" # firebase credentials json (for public mode only) [FCM__CREDENTIALS_JSON]
1820 timeout_seconds : 1 # push notification send timeout [FCM__DEBOUNCE_SECONDS]
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ type Database struct {
3434 Database string `yaml:"database" envconfig:"DATABASE__DATABASE"` // database name
3535 Timezone string `yaml:"timezone" envconfig:"DATABASE__TIMEZONE"` // database timezone
3636 Debug bool `yaml:"debug" envconfig:"DATABASE__DEBUG"` // debug mode
37+
38+ MaxOpenConns int `yaml:"max_open_conns" envconfig:"DATABASE__MAX_OPEN_CONNS"` // max open connections
39+ MaxIdleConns int `yaml:"max_idle_conns" envconfig:"DATABASE__MAX_IDLE_CONNS"` // max idle connections
3740}
3841
3942type FCMConfig struct {
Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ var Module = fx.Module(
4242 Database : cfg .Database .Database ,
4343 Timezone : cfg .Database .Timezone ,
4444 Debug : cfg .Database .Debug ,
45+
46+ MaxOpenConns : cfg .Database .MaxOpenConns ,
47+ MaxIdleConns : cfg .Database .MaxIdleConns ,
4548 }
4649 }),
4750 fx .Provide (func (cfg Config ) push.Config {
You can’t perform that action at this time.
0 commit comments