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

WriteBatch method will not write data to the DB if the list passed in only has one entry. #414

Closed
ldhasson opened this issue Aug 4, 2019 · 0 comments
Assignees
Labels

Comments

@ldhasson
Copy link
Collaborator

ldhasson commented Aug 4, 2019

The WriteBatch method loops over the data passed in but only writes in batches (thus the name). The problem is that if a single element is passed in, the main loop only adds an entry to the batch job and exits: after the loop, there is a catched to flush any incomplete batch, but that checks for index != 0

  if (index != 0 && (index + 1) % batchSize == 0)

That check will simply cause it to not execute if the list passed in only add 1 element.

@ldhasson ldhasson added the bug S1 label Aug 4, 2019
CapsicoSmith added a commit that referenced this issue Aug 5, 2019
Fixed incorrect BatchWrite when only writting one record.
CapsicoSmith added a commit that referenced this issue Aug 5, 2019
Post merge gen and commit.
@ldhasson ldhasson closed this as completed Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants