mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Update persistence/retry.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
26a0a0cd5f
commit
7add723a85
@ -59,6 +59,7 @@ func RetryWithBackoff(ctx context.Context, operation string, op func() error, ma
|
||||
|
||||
select {
|
||||
case <-time.After(jitter):
|
||||
metrics.ObserveSQLiteLockWait(operation, jitter.Seconds())
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
}
|
||||
@ -66,8 +67,6 @@ func RetryWithBackoff(ctx context.Context, operation string, op func() error, ma
|
||||
delay *= 2
|
||||
}
|
||||
|
||||
// Record final wait duration for the operation
|
||||
metrics.ObserveSQLiteLockWait(operation, time.Since(startTime).Seconds())
|
||||
return lastErr
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user