fix(db): always use begin tx (#7142)

* fix(db): always use begin tx

* fix(handler): timeout for begin
This commit is contained in:
Silvan
2024-01-04 17:12:20 +01:00
committed by GitHub
parent c0cef4983a
commit b7d027e2fd
19 changed files with 59 additions and 56 deletions

View File

@@ -95,7 +95,7 @@ Requirements:
if err != nil {
return err
}
return startZitadel(config, masterKey, server)
return startZitadel(cmd.Context(), config, masterKey, server)
},
}
@@ -119,11 +119,9 @@ type Server struct {
Shutdown chan<- os.Signal
}
func startZitadel(config *Config, masterKey string, server chan<- *Server) error {
func startZitadel(ctx context.Context, config *Config, masterKey string, server chan<- *Server) error {
showBasicInformation(config)
ctx := context.Background()
i18n.MustLoadSupportedLanguagesFromDir()
queryDBClient, err := database.Connect(config.Database, false, dialect.DBPurposeQuery)
@@ -143,7 +141,7 @@ func startZitadel(config *Config, masterKey string, server chan<- *Server) error
if err != nil {
return fmt.Errorf("cannot start key storage: %w", err)
}
keys, err := ensureEncryptionKeys(config.EncryptionKeys, keyStorage)
keys, err := ensureEncryptionKeys(ctx, config.EncryptionKeys, keyStorage)
if err != nil {
return err
}