Skip to content

Commit 87228e3

Browse files
fix(smus): fix refresh interval for tracking pending space nodes (#8204)
## Problem - On transitioning from "Stopped" to/from "Running", the space node calls trackPendingNode() which adds it to the PollingSet. The PollingSet starts polling every 5 milliseconds which calls describeSpace + describeApp ## Solution - Update the polling interval to 5sec --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 9a6693f commit 87228e3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/core/src/sagemakerunifiedstudio/explorer/nodes/sageMakerUnifiedStudioSpacesParentNode.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { PollingSet } from '../../../shared/utilities/pollingSet'
1818
import { SmusAuthenticationProvider } from '../../auth/providers/smusAuthenticationProvider'
1919
import { SmusUtils } from '../../shared/smusUtils'
2020
import { getIcon } from '../../../shared/icons'
21+
import { PENDING_NODE_POLLING_INTERVAL_MS } from './utils'
2122

2223
export class SageMakerUnifiedStudioSpacesParentNode implements TreeNode {
2324
public readonly id = 'smusSpacesParentNode'
@@ -29,7 +30,10 @@ export class SageMakerUnifiedStudioSpacesParentNode implements TreeNode {
2930
private readonly onDidChangeEmitter = new vscode.EventEmitter<void>()
3031
public readonly onDidChangeTreeItem = this.onDidChangeEmitter.event
3132
public readonly onDidChangeChildren = this.onDidChangeEmitter.event
32-
public readonly pollingSet: PollingSet<string> = new PollingSet(5, this.updatePendingNodes.bind(this))
33+
public readonly pollingSet: PollingSet<string> = new PollingSet(
34+
PENDING_NODE_POLLING_INTERVAL_MS,
35+
this.updatePendingNodes.bind(this)
36+
)
3337
private spaceAwsAccountRegion: string | undefined
3438

3539
public constructor(

packages/core/src/sagemakerunifiedstudio/explorer/nodes/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ import {
2020
} from './types'
2121
import { DataZoneConnection } from '../../shared/client/datazoneClient'
2222

23+
/**
24+
* Polling interval in milliseconds for checking space status updates
25+
*/
26+
// eslint-disable-next-line @typescript-eslint/naming-convention
27+
export const PENDING_NODE_POLLING_INTERVAL_MS = 5000
28+
2329
/**
2430
* Gets the label for a node based on its data
2531
*/

0 commit comments

Comments
 (0)