fix: push timeout (#4882) (#4885)

* push with timeout

* test: config for eventstore

(cherry picked from commit b9156da76d)

Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
Livio Spring
2022-12-15 10:40:13 +01:00
committed by GitHub
parent 3e52beaf89
commit d21bb902f1
11 changed files with 88 additions and 33 deletions

View File

@@ -320,6 +320,9 @@ Actions:
- localhost
- "127.0.0.1"
Eventstore:
PushTimeout: 15s
DefaultInstance:
InstanceName:
DefaultLanguage: en

View File

@@ -62,7 +62,7 @@ func Setup(config *Config, steps *Steps, masterKey string) {
dbClient, err := database.Connect(config.Database, false)
logging.OnError(err).Fatal("unable to connect to database")
eventstoreClient, err := eventstore.Start(dbClient)
eventstoreClient, err := eventstore.Start(&eventstore.Config{Client: dbClient})
logging.OnError(err).Fatal("unable to start eventstore")
migration.RegisterMappers(eventstoreClient)

View File

@@ -22,6 +22,7 @@ import (
"github.com/zitadel/zitadel/internal/config/systemdefaults"
"github.com/zitadel/zitadel/internal/crypto"
"github.com/zitadel/zitadel/internal/database"
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/id"
"github.com/zitadel/zitadel/internal/query/projection"
static_config "github.com/zitadel/zitadel/internal/static/config"
@@ -60,6 +61,7 @@ type Config struct {
CustomerPortal string
Machine *id.Config
Actions *actions.Config
Eventstore *eventstore.Config
}
func MustNewConfig(v *viper.Viper) *Config {

View File

@@ -99,7 +99,8 @@ func startZitadel(config *Config, masterKey string) error {
return err
}
eventstoreClient, err := eventstore.Start(dbClient)
config.Eventstore.Client = dbClient
eventstoreClient, err := eventstore.Start(config.Eventstore)
if err != nil {
return fmt.Errorf("cannot start eventstore for queries: %w", err)
}