Method ExecuteWithRetryAsync<T>(IRedbContext, Func<Task<T>>, int, int, CancellationToken)
Retries operation on a deadlock unless context is in a transaction when it
starts: then the transaction belongs to the caller, and the deadlock leaves at once.
public static Task<T> ExecuteWithRetryAsync<T>(IRedbContext context, Func<Task<T>> operation, int maxRetries = 3, int baseDelayMs = 50, CancellationToken cancellationToken = default)