Browse Source

fix: bulk update small chunks

pull/8315/head
mertmit 5 months ago
parent
commit
0869ba4618
  1. 4
      packages/nocodb/src/db/BaseModelSqlv2.ts

4
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -3711,7 +3711,7 @@ class BaseModelSqlv2 {
const toBeUpdated = [];
const toRead = [];
const readChunkSize = 100;
for (const d of updateDatas) {
for (const [i, d] of updateDatas.entries()) {
const pkValues = this._extractPksValues(d);
if (!pkValues) {
// throw or skip if no pk provided
@ -3725,7 +3725,7 @@ class BaseModelSqlv2 {
toRead.push(pkValues);
if (toRead.length >= readChunkSize) {
if (toRead.length >= readChunkSize || i === updateDatas.length - 1) {
const tempToRead = toRead.splice(0, toRead.length);
const oldRecords = await this.list(
{

Loading…
Cancel
Save