Skip to content

Commit af36b95

Browse files
Merge master into feature/v2-to-v3-migration
2 parents 2b3610e + 1c7792d commit af36b95

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/core/src/awsService/sagemaker/commands.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ export async function stopSpace(
133133
ctx: vscode.ExtensionContext,
134134
sageMakerClient?: SagemakerClient
135135
) {
136+
await tryRefreshNode(node)
137+
if (node.getStatus() === 'Stopped' || node.getStatus() === 'Stopping') {
138+
void vscode.window.showWarningMessage(`Space ${node.spaceApp.SpaceName} is already in Stopped/Stopping state.`)
139+
return
140+
} else if (node.getStatus() === 'Starting') {
141+
void vscode.window.showWarningMessage(
142+
`Space ${node.spaceApp.SpaceName} is in Starting state. Wait until it is Running to attempt stop again.`
143+
)
144+
return
145+
}
136146
const spaceName = node.spaceApp.SpaceName!
137147
const confirmed = await showConfirmationMessage({
138148
prompt: `You are about to stop this space. Any active resource will also be stopped. Are you sure you want to stop the space?`,
@@ -179,7 +189,7 @@ export async function openRemoteConnect(
179189
void vscode.window.showErrorMessage(ConnectFromRemoteWorkspaceMessage)
180190
return
181191
}
182-
192+
await tryRefreshNode(node)
183193
if (node.getStatus() === 'Stopped') {
184194
// In case of SMUS, we pass in a SM Client and for SM AI, it creates a new SM Client.
185195
const client = sageMakerClient ? sageMakerClient : new SagemakerClient(node.regionCode)

0 commit comments

Comments
 (0)