Skip to content
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

sql_connection It might be better to set PoolSize not to MaxPoolSize when MaxPoolSize==0 #9

Open
ZhengweiHou opened this issue May 11, 2023 · 0 comments

Comments

@ZhengweiHou
Copy link
Contributor

dsc/sql_connection.go

Lines 139 to 148 in 9279ced

func newSQLConnectionProvider(config *Config) ConnectionProvider {
if config.MaxPoolSize == 0 {
config.MaxPoolSize = 1
}
sqlConnectionProvider := &sqlConnectionProvider{}
var connectionProvider ConnectionProvider = sqlConnectionProvider
super := NewAbstractConnectionProvider(config, make(chan Connection, config.MaxPoolSize), connectionProvider)
sqlConnectionProvider.AbstractConnectionProvider = super
return connectionProvider
}

It might be better to set PoolSize not to MaxPoolSize when MaxPoolSize==0

	if config.PoolSize == 0 {
		config.PoolSize = 1
	}
	if config.MaxPoolSize == 0 {
		config.MaxPoolSize = config.PoolSize
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant