Skip to content

Commit d154a23

Browse files
committed
cleaner solution to cancel problem
1 parent fc5e43c commit d154a23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shared/remoteSession.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ async function addInlinePolicyWithDelay(client: IamClient, roleArn: string) {
213213
return new Promise(resolve => setTimeout(resolve, ms))
214214
}
215215

216-
await delay(policyAttachDelay - 100)
217-
if (timeout.completed) {
216+
await delay(policyAttachDelay)
217+
if (timeout.elapsedTime < policyAttachDelay) {
218218
throw new CancellationError('user')
219219
}
220220
timeout.cancel()

0 commit comments

Comments
 (0)