Use pointer when passing the connection manager around (#3152)

As otherwise existing connections aren't reused.
This commit is contained in:
Till 2023-07-19 13:37:04 +02:00 committed by GitHub
parent a01faee17c
commit 297479ea49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 143 additions and 79 deletions

View file

@ -34,7 +34,7 @@ import (
// and sets postgres connection parameters
func NewUserDatabase(
ctx context.Context,
conMan sqlutil.Connections,
conMan *sqlutil.Connections,
dbProperties *config.DatabaseOptions,
serverName spec.ServerName,
bcryptCost int,
@ -54,7 +54,7 @@ func NewUserDatabase(
// NewKeyDatabase opens a new Postgres or Sqlite database (base on dataSourceName) scheme)
// and sets postgres connection parameters.
func NewKeyDatabase(conMan sqlutil.Connections, dbProperties *config.DatabaseOptions) (KeyDatabase, error) {
func NewKeyDatabase(conMan *sqlutil.Connections, dbProperties *config.DatabaseOptions) (KeyDatabase, error) {
switch {
case dbProperties.ConnectionString.IsSQLite():
return sqlite3.NewKeyDatabase(conMan, dbProperties)