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

Run deal restarts in go routine #309

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion storagemarket/impl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ func NewClient(
// Start initializes deal processing on a StorageClient and restarts
// in progress deals
func (c *Client) Start(ctx context.Context) error {
return c.restartDeals()
go func() {
err := c.restartDeals()
if err != nil {
log.Errorf("Failed to restart deals: %s", err.Error())
}
}()
return nil
}

// Stop ends deal processing on a StorageClient
Expand Down
12 changes: 6 additions & 6 deletions storagemarket/impl/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ func (p *Provider) Start(ctx context.Context) error {
if err != nil {
return err
}

err = p.restartDeals()
if err != nil {
return err
}

go func() {
err := p.restartDeals()
if err != nil {
log.Errorf("Failed to restart deals: %s", err.Error())
}
}()
return nil
}

Expand Down