Skip to content

Commit

Permalink
rename to sendBatch()
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Chen committed Mar 16, 2021
1 parent 3d71002 commit 54acefb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dev/src/bulk-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,14 +758,14 @@ export class BulkWriter {
}

delayedExecution.promise.then(() =>
this._sendCurrentBatch(pendingBatch, flush)
this._sendBatch(pendingBatch, flush)
);
}

/**
* Sends the provided batch once the rate limiter does not require any delay.
*/
private async _sendCurrentBatch(
private async _sendBatch(
batch: BulkCommitBatch,
flush = false
): Promise<void> {
Expand All @@ -780,11 +780,11 @@ export class BulkWriter {
} else {
const delayMs = this._rateLimiter.getNextRequestDelayMs(batch._opCount);
logger(
'BulkWriter._sendCurrentBatch',
'BulkWriter._sendBatch',
tag,
`Backing off for ${delayMs} seconds`
);
delayExecution(() => this._sendCurrentBatch(batch, flush), delayMs);
delayExecution(() => this._sendBatch(batch, flush), delayMs);
}
}

Expand Down

0 comments on commit 54acefb

Please sign in to comment.