Skip to content

Commit b54fb95

Browse files
committed
Handling cancelling status too in stop job
1 parent 385ff3a commit b54fb95

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/StopAzureRMBackukpJob.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ public override void ExecuteCmdlet()
6161

6262
WriteDebug(String.Format(Resources.JobId, JobID));
6363
Guid cancelTaskId = AzureBackupClient.TriggerCancelJob(Vault.ResourceGroupName, Vault.Name, JobID);
64+
65+
if (cancelTaskId == Guid.Empty)
66+
{
67+
WriteDebug(String.Format(Resources.TriggeredCancellationJob, JobID));
68+
return;
69+
}
70+
6471
CSMOperationResult opResponse = TrackOperation(Vault.ResourceGroupName, Vault.Name, cancelTaskId);
6572

6673
if (opResponse.Status == CSMAzureBackupOperationStatus.Succeeded.ToString())

0 commit comments

Comments
 (0)