Skip to content

Commit 729e02f

Browse files
committed
fix(middleware-retry): move exportable constants to configurations
1 parent a3171e4 commit 729e02f

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

packages/middleware-retry/src/configurations.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider";
22
import { Provider, RetryStrategy } from "@aws-sdk/types";
33

4-
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "./constants";
54
import { StandardRetryStrategy } from "./defaultStrategy";
65

76
export const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
87
export const CONFIG_MAX_ATTEMPTS = "max_attempts";
98

9+
/**
10+
* The default value for how many HTTP requests an SDK should make for a
11+
* single SDK operation invocation before giving up
12+
*/
13+
export const DEFAULT_MAX_ATTEMPTS = 3;
14+
15+
/**
16+
* The default retry algorithm to use.
17+
*/
18+
export const DEFAULT_RETRY_MODE = "standard";
19+
1020
export const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors<number> = {
1121
environmentVariableSelector: (env) => {
1222
const value = env[ENV_MAX_ATTEMPTS];

packages/middleware-retry/src/constants.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,3 @@ export const INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
4747
* Header name for request retry information.
4848
*/
4949
export const REQUEST_HEADER = "amz-sdk-request";
50-
51-
/**
52-
* The default value for how many HTTP requests an SDK should make for a
53-
* single SDK operation invocation before giving up
54-
*/
55-
export const DEFAULT_MAX_ATTEMPTS = 3;
56-
57-
/**
58-
* The default retry algorithm to use.
59-
*/
60-
export const DEFAULT_RETRY_MODE = "standard";

packages/middleware-retry/src/defaultStrategy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import { SdkError } from "@aws-sdk/smithy-client";
44
import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider, RetryStrategy } from "@aws-sdk/types";
55
import { v4 } from "uuid";
66

7+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "./configurations";
78
import {
8-
DEFAULT_MAX_ATTEMPTS,
99
DEFAULT_RETRY_DELAY_BASE,
10-
DEFAULT_RETRY_MODE,
1110
INITIAL_RETRY_TOKENS,
1211
INVOCATION_ID_HEADER,
1312
REQUEST_HEADER,

0 commit comments

Comments
 (0)