File tree Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 1+ /*!
2+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+
6+ /**
7+ * Constants for AutoDebug feature retry configuration
8+ */
9+ export const autoDebugRetryConfig = {
10+ /**
11+ * Maximum number of attempts to connect AutoDebug feature to language client
12+ */
13+ MAXAttempts : 5 ,
14+
15+ /**
16+ * Initial delay in milliseconds before first retry attempt
17+ */
18+ initialDelayMs : 1000 ,
19+
20+ /**
21+ * Maximum delay in milliseconds between retry attempts
22+ */
23+ maxDelayMs : 10000 ,
24+
25+ /**
26+ * Multiplier for exponential backoff calculation
27+ */
28+ backoffMultiplier : 2 ,
29+ } as const
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ import { InlineTutorialAnnotation } from '../app/inline/tutorials/inlineTutorial
5454import { InlineChatTutorialAnnotation } from '../app/inline/tutorials/inlineChatTutorialAnnotation'
5555import { codeReviewInChat } from '../app/amazonqScan/models/constants'
5656import { AutoDebugFeature } from '../autoDebug'
57+ import { autoDebugRetryConfig } from '../autoDebug/constants'
5758
5859// Module-level registry for AutoDebug feature
5960let registeredAutoDebugFeature : AutoDebugFeature | undefined
@@ -418,10 +419,10 @@ async function onLanguageServerReady(
418419 getLogger ( 'amazonqLsp' ) . debug ( 'AutoDebug feature connected successfully' )
419420 } ,
420421 {
421- maxAttempts : 5 ,
422- initialDelayMs : 1000 ,
423- maxDelayMs : 10000 ,
424- backoffMultiplier : 2 ,
422+ maxAttempts : autoDebugRetryConfig . maxAttempts ,
423+ initialDelayMs : autoDebugRetryConfig . initialDelayMs ,
424+ maxDelayMs : autoDebugRetryConfig . maxDelayMs ,
425+ backoffMultiplier : autoDebugRetryConfig . backoffMultiplier ,
425426 onRetry : ( attempt , error ) => {
426427 getLogger ( 'amazonqLsp' ) . debug (
427428 'AutoDebug connection attempt %d failed: %s. Retrying...' ,
You can’t perform that action at this time.
0 commit comments