mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:37:30 +00:00
fix(db): add additional connection pool for projection spooling (#7094)
* fix(db): add additional connection pool for projection spooling * use correct connection pool for projections --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -17,9 +17,10 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Dialects map[string]interface{} `mapstructure:",remain"`
|
||||
EventPushConnRatio float32
|
||||
connector dialect.Connector
|
||||
Dialects map[string]interface{} `mapstructure:",remain"`
|
||||
EventPushConnRatio float64
|
||||
ProjectionSpoolerConnRatio float64
|
||||
connector dialect.Connector
|
||||
}
|
||||
|
||||
func (c *Config) SetConnector(connector dialect.Connector) {
|
||||
@@ -109,18 +110,8 @@ func QueryJSONObject[T any](ctx context.Context, db *DB, query string, args ...a
|
||||
return obj, nil
|
||||
}
|
||||
|
||||
const (
|
||||
zitadelAppName = "zitadel"
|
||||
EventstorePusherAppName = "zitadel_es_pusher"
|
||||
)
|
||||
|
||||
func Connect(config Config, useAdmin, isEventPusher bool) (*DB, error) {
|
||||
appName := zitadelAppName
|
||||
if isEventPusher {
|
||||
appName = EventstorePusherAppName
|
||||
}
|
||||
|
||||
client, err := config.connector.Connect(useAdmin, isEventPusher, config.EventPushConnRatio, appName)
|
||||
func Connect(config Config, useAdmin bool, purpose dialect.DBPurpose) (*DB, error) {
|
||||
client, err := config.connector.Connect(useAdmin, config.EventPushConnRatio, config.ProjectionSpoolerConnRatio, purpose)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user