mysql data provider: add read and write timeout

This should hopefully fix #47
This commit is contained in:
Nicola Murino 2019-09-12 16:26:47 +02:00
parent 6b33d3d9f1
commit bf00ca334d

View file

@ -19,7 +19,7 @@ func initializeMySQLProvider() error {
var connectionString string
logSender = MySQLDataProviderName
if len(config.ConnectionString) == 0 {
connectionString = fmt.Sprintf("%v:%v@tcp([%v]:%v)/%v?charset=utf8&interpolateParams=true&timeout=10s&tls=%v",
connectionString = fmt.Sprintf("%v:%v@tcp([%v]:%v)/%v?charset=utf8&interpolateParams=true&timeout=10s&tls=%v&writeTimeout=10s&readTimeout=10s",
config.Username, config.Password, config.Host, config.Port, config.Name, getSSLMode())
} else {
connectionString = config.ConnectionString