Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire storage deal provider ready event after startup completes #708

Merged
merged 1 commit into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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