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

Only force sleep to be more than 3 seconds if --no-dry-run is set #835

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/nuke.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func NewNuke(params NukeParameters, account awsutil.Account) *Nuke {
func (n *Nuke) Run() error {
var err error

if n.Parameters.ForceSleep < 3 {
return fmt.Errorf("Value for --force-sleep cannot be less than 3 seconds. This is for your own protection.")
if n.Parameters.ForceSleep < 3 && n.Parameters.NoDryRun {
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.")
}
forceSleep := time.Duration(n.Parameters.ForceSleep) * time.Second

Expand Down