Skip to content

Commit 59fc729

Browse files
Merge master into feature/hybridChat
2 parents b23cfdd + 3171de5 commit 59fc729

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

packages/core/src/codewhisperer/util/authUtil.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ export class AuthUtil {
143143

144144
if (!this.isConnected()) {
145145
await this.regionProfileManager.invalidateProfile(this.regionProfileManager.activeRegionProfile?.arn)
146+
await this.regionProfileManager.clearCache()
146147
}
147-
148-
await this.regionProfileManager.clearCache()
149148
})
150149

151150
this.regionProfileManager.onDidChangeRegionProfile(async () => {

packages/core/src/shared/utilities/resourceCache.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,24 @@ export abstract class CachedResource<V> {
6868
const duration = now() - resource.timestamp
6969
if (duration < this.expirationInMilli) {
7070
logger.debug(
71-
`cache hit, duration(%sms) is less than expiration(%sms), returning cached value %s`,
71+
`cache hit, duration(%sms) is less than expiration(%sms), returning cached value: %s`,
7272
duration,
7373
this.expirationInMilli,
7474
this.key
7575
)
7676
// release the lock
7777
await this.releaseLock(resource, cachedValue)
7878
return resource.result
79-
} else {
80-
logger.debug(
81-
`cache is stale, duration(%sms) is older than expiration(%sms), pulling latest resource %s`,
82-
duration,
83-
this.expirationInMilli,
84-
this.key
85-
)
8679
}
80+
81+
logger.debug(
82+
`cache is stale, duration(%sms) is older than expiration(%sms), pulling latest resource: %s`,
83+
duration,
84+
this.expirationInMilli,
85+
this.key
86+
)
8787
} else {
88-
logger.info(`cache miss, pulling latest resource %s`, this.key)
88+
logger.info(`cache miss, pulling latest resource: %s`, this.key)
8989
}
9090

9191
/**
@@ -104,8 +104,8 @@ export abstract class CachedResource<V> {
104104
timestamp: now(),
105105
result: latest,
106106
}
107-
logger.info(`doen loading latest resource, updating resource cache: %s`, this.key)
108107
await this.releaseLock(r)
108+
logger.info(`loaded latest resource and updated cache: %s`, this.key)
109109
return latest
110110
} catch (e) {
111111
logger.error(`failed to load latest resource, releasing lock: %s`, this.key)
@@ -129,7 +129,7 @@ export abstract class CachedResource<V> {
129129

130130
const lock = await waitUntil(async () => {
131131
const lock = await _acquireLock()
132-
logger.debug(`try obtain resource cache read write lock for resource %s`, this.key)
132+
logger.debug(`trying to acquire resource cache lock: %s`, this.key)
133133
if (lock) {
134134
return lock
135135
}

0 commit comments

Comments
 (0)