Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 399241c

Browse files
authored
Only force sleep to be more than 3 seconds if --no-dry-run is set (#835)
Useful for debugging discovery/listing. Allows setting it to 0 if the nuking isn't going to be happen.
1 parent d61ee97 commit 399241c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/nuke.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func NewNuke(params NukeParameters, account awsutil.Account) *Nuke {
3333
func (n *Nuke) Run() error {
3434
var err error
3535

36-
if n.Parameters.ForceSleep < 3 {
37-
return fmt.Errorf("Value for --force-sleep cannot be less than 3 seconds. This is for your own protection.")
36+
if n.Parameters.ForceSleep < 3 && n.Parameters.NoDryRun {
37+
return fmt.Errorf("Value for --force-sleep cannot be less than 3 seconds if --no-dry-run is set. This is for your own protection.")
3838
}
3939
forceSleep := time.Duration(n.Parameters.ForceSleep) * time.Second
4040

0 commit comments

Comments
 (0)