Skip to content

Commit

Permalink
Cherry-pick #3735: Wait the state to be synced when starting aggregat…
Browse files Browse the repository at this point in the history
…or (#3759)

* Wait the state to be synced when starting (#3735)

* remove continue
  • Loading branch information
agnusmor authored Aug 9, 2024
1 parent 9b315a1 commit 45296c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ func (a *Aggregator) Start(ctx context.Context) error {
return fmt.Errorf("failed to initialize proofs cache %w", err)
}

for !a.isSynced(ctx, nil) {
log.Info("Waiting for synchronizer to sync...")
time.Sleep(a.cfg.RetryTime.Duration)
}

address := fmt.Sprintf("%s:%d", a.cfg.Host, a.cfg.Port)
lis, err := net.Listen("tcp", address)
if err != nil {
Expand Down

0 comments on commit 45296c0

Please sign in to comment.