Skip to content

Commit

Permalink
fix: remove retryDelay option (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Dec 16, 2019
1 parent 5cdeef2 commit d21e08d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 12 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ gaxios.request({url: '/data'}).then(...);
// The number of retries already attempted.
currentRetryAttempt?: number;

// The amount of time to initially delay the retry. Defaults to 100.
retryDelay?: number;

// The HTTP Methods that will be automatically retried.
// Defaults to ['GET','PUT','HEAD','OPTIONS','DELETE']
httpMethodsToRetry?: string[];
Expand Down
3 changes: 2 additions & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018, Google, LLC.
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -114,6 +114,7 @@ export interface RetryConfig {

/**
* The amount of time to initially delay the retry. Defaults to 100.
* @deprecated
*/
retryDelay?: number;

Expand Down
2 changes: 1 addition & 1 deletion src/gaxios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018, Google, LLC.
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018, Google, LLC.
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down
3 changes: 1 addition & 2 deletions src/retry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018, Google, LLC.
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -22,7 +22,6 @@ export async function getRetryConfig(err: GaxiosError) {
config.currentRetryAttempt = config.currentRetryAttempt || 0;
config.retry =
config.retry === undefined || config.retry === null ? 3 : config.retry;
config.retryDelay = config.retryDelay || 100;
config.httpMethodsToRetry = config.httpMethodsToRetry || [
'GET',
'HEAD',
Expand Down
2 changes: 1 addition & 1 deletion test/test.getch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018, Google, LLC.
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion test/test.index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018, Google, LLC.
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down
3 changes: 1 addition & 2 deletions test/test.retry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018, Google, LLC.
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -50,7 +50,6 @@ describe('🛸 retry & exponential backoff', () => {
assert.strictEqual(config!.currentRetryAttempt, 3);
assert.strictEqual(config!.retry, 3);
assert.strictEqual(config!.noResponseRetries, 2);
assert.strictEqual(config!.retryDelay, 100);
const expectedMethods = ['GET', 'HEAD', 'PUT', 'OPTIONS', 'DELETE'];
for (const method of config!.httpMethodsToRetry!) {
assert(expectedMethods.indexOf(method) > -1);
Expand Down

0 comments on commit d21e08d

Please sign in to comment.