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

Make batch sizes configurable #4149

Merged
merged 22 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add panic for batchSize at InsertAll
  • Loading branch information
kropidlowsky committed Mar 11, 2024
commit cae4c98cb69084747821d6f9d77b4a246e22c76f
3 changes: 3 additions & 0 deletions internal/backends/postgresql/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@

err = pool.InTransaction(ctx, p, func(tx pgx.Tx) error {
batchSize := c.r.BatchSize
kropidlowsky marked this conversation as resolved.
Show resolved Hide resolved
if batchSize < 1 {
panic("batch-size should be greater than 1")

Check warning on line 139 in internal/backends/postgresql/collection.go

View check run for this annotation

Codecov / codecov/patch

internal/backends/postgresql/collection.go#L139

Added line #L139 was not covered by tests
}

var batch []*types.Document
docs := params.Docs
Expand Down
3 changes: 3 additions & 0 deletions internal/backends/sqlite/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@

err := db.InTransaction(ctx, func(tx *fsql.Tx) error {
batchSize := c.r.BatchSize
kropidlowsky marked this conversation as resolved.
Show resolved Hide resolved
if batchSize < 1 {
panic("batch-size should be greater than 1")

Check warning on line 114 in internal/backends/sqlite/collection.go

View check run for this annotation

Codecov / codecov/patch

internal/backends/sqlite/collection.go#L114

Added line #L114 was not covered by tests
}

var batch []*types.Document
docs := params.Docs
Expand Down
Loading