mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Issue #145.
This commit is contained in:
15
conn.go
15
conn.go
@@ -389,11 +389,20 @@ func timeoutCallback(ctx context.Context, mod api.Module, pDB uint32, count, tmo
|
||||
}
|
||||
|
||||
if delay = min(delay, tmout-prior); delay > 0 {
|
||||
time.Sleep(time.Duration(delay) * time.Millisecond)
|
||||
retry = 1
|
||||
delay := time.Duration(delay) * time.Millisecond
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user