Skip to content

Commit

Permalink
Round scaled timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
pomo-mondreganto committed Nov 9, 2023
1 parent 7931d75 commit 6d34899
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/exploit/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func (s *Storage) ScaleTimeouts(workers, teams int) {
continue
}
newTimeout := time.Duration(float64(ex.OriginalTimeout) / alpha)

// Round down to nearest second.
newTimeout -= newTimeout % time.Second

logrus.Infof("Scaling timeout for exploit %s: %s -> %s", ex.ID, ex.Timeout, newTimeout)
ex.Timeout = newTimeout
}
Expand Down

0 comments on commit 6d34899

Please sign in to comment.