mirror of
https://github.com/TwiN/gatus.git
synced 2026-02-15 02:45:05 +00:00
refactor: Simplify and modernize loops (#1522)
* refactor: Simplify loops * refactor: Modernize loops using range over int --------- Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
@@ -133,7 +133,7 @@ func (t *SSHTunnel) Dial(network, addr string) (net.Conn, error) {
|
||||
const maxRetries = 3
|
||||
const baseDelay = 500 * time.Millisecond
|
||||
var lastErr error
|
||||
for attempt := 0; attempt < maxRetries; attempt++ {
|
||||
for attempt := range maxRetries {
|
||||
if attempt > 0 {
|
||||
// Exponential backoff: 500ms, 1s, 2s
|
||||
delay := baseDelay << (attempt - 1)
|
||||
|
||||
Reference in New Issue
Block a user