From 9b2d0f07bacf857d9e85098e1cba947faa5abcd0 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Sat, 24 Aug 2024 11:10:33 -0600 Subject: [PATCH 1/2] feat(run): add flag to control the run loop sleep delay --- pkg/commands/nuke/nuke.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/commands/nuke/nuke.go b/pkg/commands/nuke/nuke.go index b0d17340..6f72416c 100644 --- a/pkg/commands/nuke/nuke.go +++ b/pkg/commands/nuke/nuke.go @@ -113,7 +113,7 @@ func execute(c *cli.Context) error { //nolint:funlen,gocyclo // Instantiate libnuke n := libnuke.New(params, filters, parsedConfig.Settings) - n.SetRunSleep(5 * time.Second) + n.SetRunSleep(c.Duration("sleep-delay")) n.SetLogger(logrus.WithField("component", "libnuke")) n.RegisterVersion(fmt.Sprintf("> %s", common.AppVersion.String())) @@ -251,6 +251,12 @@ func init() { //nolint:funlen Name: "max-wait-retries", Usage: "maximum number of retries to wait for dependencies to be removed", }, + &cli.DurationFlag{ + Name: "run-sleep-delay", + EnvVars: []string{"AWS_NUKE_RUN_SLEEP_DELAY"}, + Usage: "time to sleep between run/loops of resource deletions, default is 5 seconds", + Value: 5 * time.Second, + }, &cli.BoolFlag{ Name: "no-alias-check", Usage: "disable aws account alias check - requires entry in config as well", From 8a443a5c56ec3e8dc25dd3a55a06bc59f4fcbd8d Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Sat, 31 Aug 2024 17:50:56 -0600 Subject: [PATCH 2/2] fix(command/run): point to correct flag name --- pkg/commands/nuke/nuke.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/nuke/nuke.go b/pkg/commands/nuke/nuke.go index 6f72416c..cefe5937 100644 --- a/pkg/commands/nuke/nuke.go +++ b/pkg/commands/nuke/nuke.go @@ -113,7 +113,7 @@ func execute(c *cli.Context) error { //nolint:funlen,gocyclo // Instantiate libnuke n := libnuke.New(params, filters, parsedConfig.Settings) - n.SetRunSleep(c.Duration("sleep-delay")) + n.SetRunSleep(c.Duration("run-sleep-delay")) n.SetLogger(logrus.WithField("component", "libnuke")) n.RegisterVersion(fmt.Sprintf("> %s", common.AppVersion.String()))