mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-02 04:12:16 +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 <[email protected]>
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