Skip to content

Commit 4623c23

Browse files
author
Graeme Foster
committed
2nd attempt to remove the machine from the repository if it fails first time.
1 parent 1398007 commit 4623c23

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

AzureWebFarm.OctopusDeploy/Infrastructure/OctopusDeploy.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ private void HandleFailedRemoval()
7777
}
7878

7979
public void DeleteMachine()
80+
{
81+
try
82+
{
83+
DeleteMachineInternal();
84+
}
85+
catch (Exception e)
86+
{
87+
Log.Error(e, "Initial attempt to remove machine from Octopus repository failed. Will retry 1 time.");
88+
DeleteMachineInternal();
89+
Log.Information("Successfully deleted machine from Octopus repository");
90+
}
91+
}
92+
93+
private void DeleteMachineInternal()
8094
{
8195
var machine = _repository.Machines.FindByName(_machineName);
8296
_repository.Machines.Delete(machine);

0 commit comments

Comments
 (0)