diff --git a/packages/core/src/awsService/ec2/explorer/ec2ParentNode.ts b/packages/core/src/awsService/ec2/explorer/ec2ParentNode.ts index b01a310323f..f751f7e0c61 100644 --- a/packages/core/src/awsService/ec2/explorer/ec2ParentNode.ts +++ b/packages/core/src/awsService/ec2/explorer/ec2ParentNode.ts @@ -52,15 +52,19 @@ export class Ec2ParentNode extends AWSTreeNodeBase { ) } - private updatePendingNodes() { - this.pollingSet.forEach(async (instanceId) => { + private async updatePendingNodes() { + for (const instanceId of this.pollingSet.values()) { const childNode = this.ec2InstanceNodes.get(instanceId)! - await childNode.updateStatus() - if (!childNode.isPending()) { - this.pollingSet.delete(instanceId) - await childNode.refreshNode() - } - }) + await this.updatePendingNode(childNode) + } + } + + private async updatePendingNode(node: Ec2InstanceNode) { + await node.updateStatus() + if (!node.isPending()) { + this.pollingSet.delete(node.InstanceId) + await node.refreshNode() + } } public async clearChildren() { diff --git a/packages/core/src/test/techdebt.test.ts b/packages/core/src/test/techdebt.test.ts index 4818da88070..d83a8d68c85 100644 --- a/packages/core/src/test/techdebt.test.ts +++ b/packages/core/src/test/techdebt.test.ts @@ -53,6 +53,6 @@ describe('tech debt', function () { // Monitor telemtry to determine removal or snooze // toolkit_showNotification.id = sessionSeparation // auth_modifyConnection.action = deleteProfile OR auth_modifyConnection.source contains CodeCatalyst - fixByDate('2024-9-30', 'Remove the edge case code from the commit that this test is a part of.') + fixByDate('2024-10-30', 'Remove the edge case code from the commit that this test is a part of.') }) })