mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-17 15:43:03 +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:
@@ -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