Improve test cases and logging

This commit is contained in:
Nicola Murino
2019-07-26 11:34:44 +02:00
parent e0a550b216
commit 417b173c78
11 changed files with 654 additions and 56 deletions

View File

@@ -24,11 +24,11 @@ func initializePGSQLProvider() error {
dbHandle, err = sql.Open("postgres", connectionString)
if err == nil {
numCPU := runtime.NumCPU()
logger.Debug(logSender, "postgres database handle created, connection string: %v, connections: %v", connectionString, numCPU)
logger.Debug(logSender, "postgres database handle created, connection string: \"%v\", pool size: %v", connectionString, numCPU)
dbHandle.SetMaxIdleConns(numCPU)
dbHandle.SetMaxOpenConns(numCPU)
} else {
logger.Warn(logSender, "error creating postgres database handler, connection string: %v, error: %v", connectionString, err)
logger.Warn(logSender, "error creating postgres database handler, connection string: \"%v\", error: %v", connectionString, err)
}
return err
}