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:
Mignonne Patterson 2025-10-28 07:53:00 +00:00 committed by GitHub
parent 26a0a0cd5f
commit 7add723a85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}