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

Small issue in Bulk Indexer flush function, debug message #400

Open
maxbolgarin opened this issue Jan 15, 2022 · 0 comments
Open

Small issue in Bulk Indexer flush function, debug message #400

maxbolgarin opened this issue Jan 15, 2022 · 0 comments

Comments

@maxbolgarin
Copy link

w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", err))

if res.IsError() {
	atomic.AddUint64(&w.bi.stats.numFailed, uint64(len(w.items)))
	if w.bi.config.OnError != nil {
		w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", err))
	}
	return fmt.Errorf("flush: %s", res.String())
}

When you enter this if, you will see "flush: nil" message because err == nil here.
My suggestion:

if w.bi.config.OnError != nil {
	w.bi.config.OnError(ctx, fmt.Errorf("flush: %s", res.String()))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant