mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
refactor(database): exchange connection pool (#8325)
# Which Problems Are Solved The connection pool of go uses a high amount of database connections. # How the Problems Are Solved The standard lib connection pool was replaced by `pgxpool.Pool` # Additional Changes The `db.BeginTx`-spans are removed because they cause to much noise in the traces. # Additional Context - part of https://github.com/zitadel/zitadel/issues/7639
This commit is contained in:
@@ -90,9 +90,7 @@ func (q *Queries) latestState(ctx context.Context, projections ...table) (state
|
||||
}
|
||||
|
||||
func (q *Queries) ClearCurrentSequence(ctx context.Context, projectionName string) (err error) {
|
||||
ctx, spanBeginTx := tracing.NewNamedSpan(ctx, "db.BeginTx")
|
||||
tx, err := q.client.BeginTx(ctx, nil)
|
||||
spanBeginTx.EndWithError(err)
|
||||
if err != nil {
|
||||
return zerrors.ThrowInternal(err, "QUERY-9iOpr", "Errors.RemoveFailed")
|
||||
}
|
||||
@@ -205,7 +203,7 @@ func reset(ctx context.Context, tx *sql.Tx, tables []string, projectionName stri
|
||||
if err != nil {
|
||||
return zerrors.ThrowInternal(err, "QUERY-Ff3tw", "Errors.RemoveFailed")
|
||||
}
|
||||
_, err = tx.Exec(update, args...)
|
||||
_, err = tx.ExecContext(ctx, update, args...)
|
||||
if err != nil {
|
||||
return zerrors.ThrowInternal(err, "QUERY-NFiws", "Errors.RemoveFailed")
|
||||
}
|
||||
|
Reference in New Issue
Block a user