mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-30 02:52: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:
@@ -62,6 +62,7 @@ func NewProjectionHandler(
|
||||
query SearchQuery,
|
||||
lock Lock,
|
||||
unlock Unlock,
|
||||
initialized <-chan bool,
|
||||
) *ProjectionHandler {
|
||||
concurrentInstances := int(config.ConcurrentInstances)
|
||||
if concurrentInstances < 1 {
|
||||
@@ -82,9 +83,12 @@ func NewProjectionHandler(
|
||||
concurrentInstances: concurrentInstances,
|
||||
}
|
||||
|
||||
go h.subscribe(ctx)
|
||||
go func() {
|
||||
<-initialized
|
||||
go h.subscribe(ctx)
|
||||
|
||||
go h.schedule(ctx)
|
||||
go h.schedule(ctx)
|
||||
}()
|
||||
|
||||
return h
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user