Skip to content

Commit 519530f

Browse files
committed
chore: default
1 parent 7fbefde commit 519530f

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

templates/go/ingestion_helpers.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ func (c *APIClient) ChunkedPush(indexName string, objects []map[string]any, acti
1717
}
1818

1919
waitBatchSize := conf.batchSize / 10
20+
if waitBatchSize < 1 {
21+
waitBatchSize = conf.batchSize
22+
}
2023

2124
for _, opt := range opts {
2225
opt.apply(&conf)

templates/java/api_helpers.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public <T> List<WatchResponse> chunkedPush(
4646
List<T> records = new ArrayList<>();
4747
Int count = 0;
4848
Int waitBatchSize = batchSize / 10;
49+
if (waitBatchSize < 1) {
50+
waitBatchSize = batchSize;
51+
}
4952

5053
for (T item : objects) {
5154
if (records.size() == batchSize || count == objects.size() - 1) {

templates/php/api.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@ use Algolia\AlgoliaSearch\Exceptions\NotFoundException;
338338
$records = [];
339339
$count = 0;
340340
$waitBatchSize = (int)($batchSize / 10);
341+
if ($waitBatchSize < 1) {
342+
$waitBatchSize = $batchSize;
343+
}
341344

342345
foreach ($objects as $object) {
343346
$records[] = $object;

templates/python/ingestion_helpers.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
records: List[PushTaskRecords] = []
1515
responses: List[WatchResponse] = []
1616
wait_batch_size = batch_size // 10
17-
if wait_batch_size == 0:
17+
if wait_batch_size < 1:
1818
wait_batch_size = batch_size
1919
for i, obj in enumerate(objects):
2020
records.append(obj) # pyright: ignore

0 commit comments

Comments
 (0)