cleanup and refactors

This commit is contained in:
Jay
2026-05-20 22:49:25 -04:00
parent cda6d286ab
commit f1afca7921
10 changed files with 628 additions and 496 deletions
+4
View File
@@ -69,6 +69,7 @@ func AcquireSocket(
logger.Debug("dialing", "attempt", retryMgr.RetryCount()+1)
}
// dial
socket, resp, err := dialer.DialContext(ctx, url, header)
if err == nil {
if logger != nil {
@@ -77,7 +78,9 @@ func AcquireSocket(
return socket, resp, nil
}
// dial failed, retry
if !retryMgr.ShouldRetry() {
// retry policy expired
if logger != nil {
logger.Error("dial failed, max retries reached",
"error", err,
@@ -95,6 +98,7 @@ func AcquireSocket(
"next_delay", delay)
}
// context cancellable backoff
select {
case <-time.After(delay):
case <-ctx.Done():