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

MB-55637: Adapting signature of scorch's async onError callback #1800

Merged
merged 1 commit into from
Mar 17, 2023
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
2 changes: 1 addition & 1 deletion index/scorch/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import "time"

// RegistryAsyncErrorCallbacks should be treated as read-only after
// process init()'ialization.
var RegistryAsyncErrorCallbacks = map[string]func(error){}
var RegistryAsyncErrorCallbacks = map[string]func(error, string){}

// RegistryEventCallbacks should be treated as read-only after
// process init()'ialization.
Expand Down
4 changes: 2 additions & 2 deletions index/scorch/scorch.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type Scorch struct {
asyncTasks sync.WaitGroup

onEvent func(event Event)
onAsyncError func(err error)
onAsyncError func(err error, path string)

forceMergeRequestCh chan *mergerCtrl

Expand Down Expand Up @@ -185,7 +185,7 @@ func (s *Scorch) fireEvent(kind EventKind, dur time.Duration) {

func (s *Scorch) fireAsyncError(err error) {
if s.onAsyncError != nil {
s.onAsyncError(err)
s.onAsyncError(err, s.path)
}
atomic.AddUint64(&s.stats.TotOnErrors, 1)
}
Expand Down