mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-17 00:23:41 +00:00
fix: wait for projection initialization to be done (#4473)
* fix: wait for projection initialization to be done * close channel Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
@@ -186,9 +186,11 @@ type ForeignKey struct {
|
||||
}
|
||||
|
||||
// Init implements handler.Init
|
||||
func (h *StatementHandler) Init(ctx context.Context, checks ...*handler.Check) error {
|
||||
func (h *StatementHandler) Init(ctx context.Context, initialized chan<- bool, checks ...*handler.Check) error {
|
||||
for _, check := range checks {
|
||||
if check == nil || check.IsNoop() {
|
||||
initialized <- true
|
||||
close(initialized)
|
||||
return nil
|
||||
}
|
||||
tx, err := h.client.BeginTx(ctx, nil)
|
||||
@@ -211,6 +213,8 @@ func (h *StatementHandler) Init(ctx context.Context, checks ...*handler.Check) e
|
||||
return err
|
||||
}
|
||||
}
|
||||
initialized <- true
|
||||
close(initialized)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user