fix(cmd): Respect DB max open connections (#2094)

Both the init and migrate commands were ignoring
the configured max_open_connections database
setting. This fix ensures that both commands
respect the limits.
This commit is contained in:
Johan Brandhorst-Satzkorn authored and GitHub committed 2022-05-23 08:21:15 -04:00
1 parent c2d632f1a2
commit ec608b79da
3 files changed
+6 -3

No files matched your search

+3 -1
View File
@@ -239,6 +239,8 @@ func (c *InitCommand) Run(args []string) (retCode int) {
return base.CommandUserError
}
c.DatabaseMaxOpenConnections = c.Config.Controller.Database.MaxOpenConnections
var migrationUrlToParse string
if c.Config.Controller.Database.MigrationUrl != "" {
migrationUrlToParse = c.Config.Controller.Database.MigrationUrl
@@ -262,7 +264,7 @@ func (c *InitCommand) Run(args []string) (retCode int) {
return base.CommandUserError
}
clean, errCode := migrateDatabase(c.Context, c.UI, dialect, migrationUrl, false)
clean, errCode := migrateDatabase(c.Context, c.UI, dialect, migrationUrl, false, c.DatabaseMaxOpenConnections)
defer clean()
switch errCode {
case 0: