From 643a58c769ab82e5ce2b757956809b0954778571 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 28 May 2023 21:24:57 +0200 Subject: [PATCH] Folder and Link resource handling - refactor duplicate code --- routines/implementations.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/routines/implementations.go b/routines/implementations.go index 6bf15a09..c2f1473d 100644 --- a/routines/implementations.go +++ b/routines/implementations.go @@ -134,12 +134,11 @@ var RollbackResources = Task{ // return: bool: whether to consider resource group for requiring rollback ; error func processResourceGroup(taskRunner *TaskRunner, resourceGroup system.ResourceGroup, isRollbackMode bool, ignoreBackup bool) (bool, error) { var uncompletedSpinners []*ysmrr.Spinner - var errors []error // ROLLBACK mode if isRollbackMode && resourceGroup.RollbackResourceFunc != nil { if err := resourceGroup.RollbackResourceFunc(); err != nil { - errors = append(errors, fmt.Errorf("Unable to completely rollback resources: %s", err)) + return false, err } } @@ -182,7 +181,7 @@ func processResourceGroup(taskRunner *TaskRunner, resourceGroup system.ResourceG for _, spinner := range uncompletedSpinners { spinner.Complete() } - return true, nil + return !isRollbackMode, nil } var CreateResources = Task{