Fix captured (and discarded) Execute exceptions
Using ExecuteAndCapture (and the async version) requires something to manage the captured exception, which we don't do. Errors would be silently dropped and the writes/deletes treated as if they succeeded.
This commit is contained in:
+2
-2
@@ -88,13 +88,13 @@ public class OptimisticLockBehavior : IEntityFrameworkCoreLockingBehavior
|
||||
/// <inheritdoc/>
|
||||
public void OnSaveChanges(JellyfinDbContext context, Action saveChanges)
|
||||
{
|
||||
_writePolicy.ExecuteAndCapture(saveChanges);
|
||||
_writePolicy.Execute(saveChanges);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task OnSaveChangesAsync(JellyfinDbContext context, Func<Task> saveChanges)
|
||||
{
|
||||
await _writeAsyncPolicy.ExecuteAndCaptureAsync(saveChanges).ConfigureAwait(false);
|
||||
await _writeAsyncPolicy.ExecuteAsync(saveChanges).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private sealed class TransactionLockingInterceptor : DbTransactionInterceptor
|
||||
|
||||
Reference in New Issue
Block a user