This commit is contained in:
Nuno Cruces
2024-09-03 12:24:03 +01:00
parent ff9f27a778
commit cf7b89d3c4

15
conn.go
View File

@@ -389,11 +389,20 @@ func timeoutCallback(ctx context.Context, mod api.Module, pDB uint32, count, tmo
} }
if delay = min(delay, tmout-prior); delay > 0 { if delay = min(delay, tmout-prior); delay > 0 {
time.Sleep(time.Duration(delay) * time.Millisecond) delay := time.Duration(delay) * time.Millisecond
retry = 1 if c.interrupt == nil || c.interrupt.Done() == nil {
time.Sleep(delay)
return 1
}
select {
case <-c.interrupt.Done():
//
case <-time.After(delay):
return 1
}
} }
} }
return retry return 0
} }
// BusyHandler registers a callback to handle [BUSY] errors. // BusyHandler registers a callback to handle [BUSY] errors.