Skip to content

Commit 4d22264

Browse files
committed
fixup
1 parent a9fcf6e commit 4d22264

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ import { registerInlineCompletion } from '../app/inline/completion'
1111
import { AmazonQLspAuth, encryptionKey, notificationTypes } from './auth'
1212
import { AuthUtil } from 'aws-core-vscode/codewhisperer'
1313
import { ConnectionMetadata } from '@aws/language-server-runtimes/protocol'
14-
import { ResourcePaths, Settings, oidcClientName, createServerOptions, globals } from 'aws-core-vscode/shared'
14+
import {
15+
ResourcePaths,
16+
Settings,
17+
oidcClientName,
18+
createServerOptions,
19+
globals,
20+
getLogger,
21+
} from 'aws-core-vscode/shared'
1522

1623
const localize = nls.loadMessageBundle()
1724

@@ -101,8 +108,13 @@ export async function startLanguageServer(extensionContext: vscode.ExtensionCont
101108
})
102109

103110
// Temporary code for pen test. Will be removed when we switch to the real flare auth
104-
setInterval(async () => {
105-
await auth.init()
111+
const authInterval = setInterval(async () => {
112+
try {
113+
await auth.init()
114+
} catch (e) {
115+
getLogger('amazonqLsp').error('Unable to update bearer token: %s', (e as Error).message)
116+
clearInterval(authInterval)
117+
}
106118
}, 300000) // every 5 minutes
107119

108120
toDispose.push(

0 commit comments

Comments
 (0)