File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/core/src/awsService/sagemaker Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments