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

Fix error caused by incorrect select case statement #103

Merged
merged 1 commit into from
May 13, 2024
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
7 changes: 2 additions & 5 deletions sparse/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,8 @@ func (client *syncClient) syncContent() error {
// the below select will exit once all error channels are closed, or a single
// channel has run into an error, which will lead to the ctx being cancelled
mergedErrc := mergeErrorChannels(ctx, errorChannels...)
select {
case err = <-mergedErrc:
break
default:
}
err = <-mergedErrc

return err
}

Expand Down
6 changes: 1 addition & 5 deletions sparse/sfold.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ func coalesce(parentFileIo, childFileIo FileIoProcessor, fileSize int64, ops Fil
// the below select will exit once all error channels are closed, or a single
// channel has run into an error, which will lead to the ctx being cancelled
mergedErrc := mergeErrorChannels(ctx, errorChannels...)
select {
case err = <-mergedErrc:
break
default:
}
err = <-mergedErrc

log.Debugf("Finished fold for parent %v, child %v, size %v, elapsed %.2fs",
parentFileIo.Name(), childFileIo.Name(), fileSize,
Expand Down
6 changes: 1 addition & 5 deletions sparse/sprune.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,7 @@ func prune(parentFileIo, childFileIo FileIoProcessor, fileSize int64, ops FileHa
// the below select will exit once all error channels are closed, or a single
// channel has run into an error, which will lead to the ctx being cancelled
mergedErrc := mergeErrorChannels(ctx, errorChannels...)
select {
case err = <-mergedErrc:
break
default:
}
err = <-mergedErrc

log.Debugf("Finished pruning for parent %v, child %v, size %v, elapsed %.2fs",
parentFileIo.Name(), childFileIo.Name(), fileSize,
Expand Down