@@ -40,6 +40,7 @@ import { DevSettings } from '../settings'
4040import { getServiceEnvVarConfig } from '../vscode/env'
4141import { AwsCommand } from '../awsClientBuilderV3'
4242import { ClientWrapper } from './clientWrapper'
43+ import { StandardRetryStrategy } from '@smithy/util-retry'
4344
4445export interface CodeCatalystConfig {
4546 readonly region : string
@@ -137,13 +138,15 @@ function toBranch(
137138async function createCodeCatalystClient (
138139 connection : SsoConnection ,
139140 regionCode : string ,
140- endpoint : string
141+ endpoint : string ,
142+ maxRetries : number
141143) : Promise < CodeCatalyst > {
142144 const c = await globals . sdkClientBuilder . createAwsService ( CodeCatalyst , {
143145 region : regionCode ,
144146 correctClockSkew : true ,
145147 endpoint : endpoint ,
146148 token : new TokenProvider ( connection ) ,
149+ maxRetries,
147150 } as ServiceConfigurationOptions )
148151
149152 return c
@@ -152,14 +155,16 @@ async function createCodeCatalystClient(
152155function createCodeCatalystClientV3 (
153156 connection : SsoConnection ,
154157 regionCode : string ,
155- endpoint : string
158+ endpoint : string ,
159+ maxRetries : number
156160) : CodeCatalystSDKClient {
157161 return globals . sdkClientBuilderV3 . createAwsService ( {
158162 serviceClient : CodeCatalystSDKClient ,
159163 clientOptions : {
160164 region : regionCode ,
161165 endpoint : endpoint ,
162166 token : new TokenProvider ( connection ) ,
167+ retryStrategy : new StandardRetryStrategy ( maxRetries ) ,
163168 } ,
164169 } )
165170}
@@ -192,10 +197,11 @@ export async function createClient(
192197 connection : SsoConnection ,
193198 regionCode = getCodeCatalystConfig ( ) . region ,
194199 endpoint = getCodeCatalystConfig ( ) . endpoint ,
200+ maxRetries : number = 1 ,
195201 authOptions : AuthOptions = { }
196202) : Promise < CodeCatalystClient > {
197- const sdkClient = await createCodeCatalystClient ( connection , regionCode , endpoint )
198- const sdkv3Client = createCodeCatalystClientV3 ( connection , regionCode , endpoint )
203+ const sdkClient = await createCodeCatalystClient ( connection , regionCode , endpoint , maxRetries )
204+ const sdkv3Client = createCodeCatalystClientV3 ( connection , regionCode , endpoint , maxRetries )
199205 const c = new CodeCatalystClientInternal ( connection , sdkClient , sdkv3Client )
200206 try {
201207 await c . verifySession ( )
0 commit comments