From 6d348992532c36f9b8b7d2bfca85d6ecd9d6d972 Mon Sep 17 00:00:00 2001 From: Roman Nikitin Date: Thu, 9 Nov 2023 10:27:14 +0300 Subject: [PATCH] Round scaled timeout --- internal/exploit/storage.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/exploit/storage.go b/internal/exploit/storage.go index e157cab..6f8f55c 100644 --- a/internal/exploit/storage.go +++ b/internal/exploit/storage.go @@ -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 }