Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Commit b7f29ed

Browse files
authored
feat: add custom retry options (#1088)
* feat: add custom retry options * lint * update test
1 parent b49fc4d commit b7f29ed

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/bigquery.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ export class BigQuery extends Service {
326326
baseUrl,
327327
scopes: ['https://www.googleapis.com/auth/bigquery'],
328328
packageJson: require('../../package.json'),
329+
autoRetry: options.autoRetry,
330+
maxRetries: options.maxRetries,
329331
};
330332

331333
if (options.scopes) {

test/bigquery.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,26 @@ describe('BigQuery', () => {
283283
assert.deepStrictEqual(calledWith.scopes, expectedScopes);
284284
});
285285

286+
it('should pass autoRetry from options', () => {
287+
const retry = false;
288+
const bq = new BigQuery({
289+
autoRetry: retry,
290+
});
291+
292+
const calledWith = bq.calledWith_[0];
293+
assert.deepStrictEqual(calledWith.autoRetry, retry);
294+
});
295+
296+
it('should pass maxRetries from options', () => {
297+
const retryVal = 1;
298+
const bq = new BigQuery({
299+
maxRetries: retryVal,
300+
});
301+
302+
const calledWith = bq.calledWith_[0];
303+
assert.deepStrictEqual(calledWith.maxRetries, retryVal);
304+
});
305+
286306
it('should not modify options argument', () => {
287307
const options = {
288308
projectId: PROJECT_ID,

0 commit comments

Comments
 (0)