Skip to content

Commit

Permalink
fix: fire storage deal provider ready event after startup completes
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed May 9, 2022
1 parent f7eaf66 commit a9652b0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions storagemarket/impl/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,13 +763,20 @@ func (p *Provider) dispatch(eventName fsm.EventName, deal fsm.StateType) {
}
}

func (p *Provider) start(ctx context.Context) error {
func (p *Provider) start(ctx context.Context) (err error) {
defer func() {
publishErr := p.readyMgr.FireReady(err)
if publishErr != nil {
if err != nil {
log.Warnf("failed to publish storage provider ready event with err %s: %s", err, publishErr)
} else {
log.Warnf("failed to publish storage provider ready event: %s", publishErr)
}
}
}()

// Run datastore and DAG store migrations
deals, err := p.runMigrations(ctx)
publishErr := p.readyMgr.FireReady(err)
if publishErr != nil {
log.Warnf("publish storage provider ready event: %s", err.Error())
}
if err != nil {
return err
}
Expand Down

0 comments on commit a9652b0

Please sign in to comment.