Skip to content

Commit

Permalink
trunk fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bohendo committed Mar 13, 2024
1 parent 1dbab0f commit 4671849
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cmd/cloudexec/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ConfirmDeleteDroplets(config config.Config, dropletName string, instanceToJ
if err != nil {
return confirmedToDelete, fmt.Errorf("Failed to destroy droplet: %w", err)
}
confirmedToDelete = append(confirmedToDelete, instance.ID)
confirmedToDelete = append(confirmedToDelete, instance.ID)
}
}
} else {
Expand Down
26 changes: 13 additions & 13 deletions cmd/cloudexec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ func main() {
return err
}

// deletes droplets per user feedback & returns a list of job IDs for state updates
confirmedToDelete, err := ConfirmDeleteDroplets(config, dropletName, instanceToJobs)
// deletes droplets per user feedback & returns a list of job IDs for state updates
confirmedToDelete, err := ConfirmDeleteDroplets(config, dropletName, instanceToJobs)
if err != nil {
return err
}
if (len(confirmedToDelete) == 0) {
return nil
}
if len(confirmedToDelete) == 0 {
return nil
}

existingState, err := state.GetState(config, bucketName)
if err != nil {
Expand Down Expand Up @@ -264,16 +264,16 @@ func main() {
if err != nil {
return err
}
confirmedToDelete, err := ConfirmDeleteDroplets(config, dropletName, instanceToJobs)
confirmedToDelete, err := ConfirmDeleteDroplets(config, dropletName, instanceToJobs)
if err != nil {
return err
}
if (len(confirmedToDelete) > 0) {
err = ssh.DeleteSSHConfig(user, "cloudexec")
if err != nil {
return err
}
}
if len(confirmedToDelete) > 0 {
err = ssh.DeleteSSHConfig(user, "cloudexec")
if err != nil {
return err
}
}
return nil
},
},
Expand Down Expand Up @@ -487,7 +487,7 @@ func main() {
if err != nil {
return err
}
// If we got a job Id, get that job's state, else continue
// If we got a job Id, get that job's state, else continue
latestJob := existingState.GetLatestJob()
jobStatus := latestJob.Status

Expand Down
14 changes: 7 additions & 7 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ func (s *State) CancelRunningJobs(config config.Config, bucketName string, toCan
// Mark any running jobs as cancelled
for i, job := range s.Jobs {
if job.Status == Running || job.Status == Provisioning {
for _, id := range toCancel {
if id == job.ID {
fmt.Printf("Setting status of job %d to 'Cancelled'\n", job.ID)
s.Jobs[i].Status = Cancelled
break
}
}
for _, id := range toCancel {
if id == job.ID {
fmt.Printf("Setting status of job %d to 'Cancelled'\n", job.ID)
s.Jobs[i].Status = Cancelled
break
}
}
}
}

Expand Down

0 comments on commit 4671849

Please sign in to comment.