|
|
@ -677,7 +677,7 @@ SELECT z."value", z."score"
|
|
|
|
if (process && process.constructor && process.constructor.name !== 'AsyncFunction') {
|
|
|
|
if (process && process.constructor && process.constructor.name !== 'AsyncFunction') {
|
|
|
|
process = util.promisify(process);
|
|
|
|
process = util.promisify(process);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let iteration = 1;
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
/* eslint-disable no-await-in-loop */
|
|
|
|
/* eslint-disable no-await-in-loop */
|
|
|
|
let rows = await cursor.readAsync(batchSize);
|
|
|
|
let rows = await cursor.readAsync(batchSize);
|
|
|
@ -692,14 +692,15 @@ SELECT z."value", z."score"
|
|
|
|
rows = rows.map(r => r.value);
|
|
|
|
rows = rows.map(r => r.value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (iteration > 1 && options.interval) {
|
|
|
|
|
|
|
|
await sleep(options.interval);
|
|
|
|
|
|
|
|
}
|
|
|
|
await process(rows);
|
|
|
|
await process(rows);
|
|
|
|
|
|
|
|
iteration += 1;
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|
await client.release();
|
|
|
|
await client.release();
|
|
|
|
throw err;
|
|
|
|
throw err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (options.interval) {
|
|
|
|
|
|
|
|
await sleep(options.interval);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|