Skip to content

Commit

Permalink
Try to delete the workspace instead of fail (#3589)
Browse files Browse the repository at this point in the history
* Try to delete the workspace instead of fail

Creation of the new workspace will fail anyway it it still exists.
But 2 agents may delete the same workspace at the ecact same time.

Fixes: #3588

* Remove newline

Co-authored-by: Alexander Smolyakov <[email protected]>
  • Loading branch information
jessehouwing and Alexander Smolyakov authored Nov 3, 2021
1 parent 613d5c8 commit 124d863
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Agent.Plugins/TfsVCSourceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ await RemoveConflictingWorkspacesAsync(
tfWorkspaces = await tf.WorkspacesAsync(matchWorkspaceNameOnAnyComputer: true);
foreach (ITfsVCWorkspace tfWorkspace in tfWorkspaces ?? new ITfsVCWorkspace[0])
{
await tf.WorkspaceDeleteAsync(tfWorkspace);
await tf.TryWorkspaceDeleteAsync(tfWorkspace);
}

// Recreate the sources directory.
Expand Down

0 comments on commit 124d863

Please sign in to comment.