File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
AzureWebFarm.OctopusDeploy/Infrastructure Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -78,15 +78,20 @@ private void HandleFailedRemoval()
7878
7979 public void DeleteMachine ( )
8080 {
81- try
81+ var remainingAttempts = 5 ;
82+ while ( remainingAttempts > 0 )
8283 {
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" ) ;
84+ try
85+ {
86+ DeleteMachineInternal ( ) ;
87+ return ;
88+ }
89+ catch ( Exception e )
90+ {
91+ remainingAttempts -- ;
92+ Log . Error ( e , "Initial attempt to remove machine from Octopus repository failed. Will retry {attempts} time(s)." , remainingAttempts ) ;
93+ Thread . Sleep ( TimeSpan . FromSeconds ( 3 ) ) ;
94+ }
9095 }
9196 }
9297
You can’t perform that action at this time.
0 commit comments