From bce4397be02fa109c4b5a60a285b17e385294d93 Mon Sep 17 00:00:00 2001 From: Tyrone Smith Date: Mon, 7 Jul 2025 11:11:18 -0700 Subject: [PATCH] fix(amazonq): remove jitter for validation call of profiles --- .../region/regionProfileManager.ts | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/packages/core/src/codewhisperer/region/regionProfileManager.ts b/packages/core/src/codewhisperer/region/regionProfileManager.ts index ce33bfd925d..e463321be19 100644 --- a/packages/core/src/codewhisperer/region/regionProfileManager.ts +++ b/packages/core/src/codewhisperer/region/regionProfileManager.ts @@ -287,38 +287,6 @@ export class RegionProfileManager { } await this.switchRegionProfile(previousSelected, 'reload') - - // cross-validation - // jitter of 0 ~ 5 second - const jitterInSec = Math.floor(Math.random() * 6) - const jitterInMs = jitterInSec * 1000 - setTimeout(async () => { - this.getProfiles() - .then(async (profiles) => { - const r = profiles.find((it) => it.arn === previousSelected.arn) - if (!r) { - telemetry.amazonq_profileState.emit({ - source: 'reload', - amazonQProfileRegion: 'not-set', - reason: 'profile could not be selected', - result: 'Failed', - }) - - await this.invalidateProfile(previousSelected.arn) - RegionProfileManager.logger.warn( - `invlaidating ${previousSelected.name} profile, arn=${previousSelected.arn}` - ) - } - }) - .catch((e) => { - telemetry.amazonq_profileState.emit({ - source: 'reload', - amazonQProfileRegion: 'not-set', - reason: (e as Error).message, - result: 'Failed', - }) - }) - }, jitterInMs) } private loadPersistedRegionProfle(): { [label: string]: RegionProfile } {