Skip to content

Commit 3a05fa6

Browse files
committed
pr
1 parent 4d6d939 commit 3a05fa6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/MongoDB.Driver/OperationExecutor.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ public TResult ExecuteReadOperation<TResult>(
5050
Ensure.IsNotNull(session, nameof(session));
5151
ThrowIfDisposed();
5252

53-
var cancellationContext = options.ToOperationContext(cancellationToken);
53+
var operationContext = options.ToOperationContext(cancellationToken);
5454
var readPreference = options.GetEffectiveReadPreference(session);
5555
using var binding = CreateReadBinding(session, readPreference, allowChannelPinning);
56-
return operation.Execute(cancellationContext, binding);
56+
return operation.Execute(operationContext, binding);
5757
}
5858

5959
public async Task<TResult> ExecuteReadOperationAsync<TResult>(
@@ -68,10 +68,10 @@ public async Task<TResult> ExecuteReadOperationAsync<TResult>(
6868
Ensure.IsNotNull(session, nameof(session));
6969
ThrowIfDisposed();
7070

71-
var cancellationContext = options.ToOperationContext(cancellationToken);
71+
var operationContext = options.ToOperationContext(cancellationToken);
7272
var readPreference = options.GetEffectiveReadPreference(session);
7373
using var binding = CreateReadBinding(session, readPreference, allowChannelPinning);
74-
return await operation.ExecuteAsync(cancellationContext, binding).ConfigureAwait(false);
74+
return await operation.ExecuteAsync(operationContext, binding).ConfigureAwait(false);
7575
}
7676

7777
public TResult ExecuteWriteOperation<TResult>(
@@ -86,9 +86,9 @@ public TResult ExecuteWriteOperation<TResult>(
8686
Ensure.IsNotNull(session, nameof(session));
8787
ThrowIfDisposed();
8888

89-
var cancellationContext = options.ToOperationContext(cancellationToken);
89+
var operationContext = options.ToOperationContext(cancellationToken);
9090
using var binding = CreateReadWriteBinding(session, allowChannelPinning);
91-
return operation.Execute(cancellationContext, binding);
91+
return operation.Execute(operationContext, binding);
9292
}
9393

9494
public async Task<TResult> ExecuteWriteOperationAsync<TResult>(
@@ -103,9 +103,9 @@ public async Task<TResult> ExecuteWriteOperationAsync<TResult>(
103103
Ensure.IsNotNull(session, nameof(session));
104104
ThrowIfDisposed();
105105

106-
var cancellationContext = options.ToOperationContext(cancellationToken);
106+
var operationContext = options.ToOperationContext(cancellationToken);
107107
using var binding = CreateReadWriteBinding(session, allowChannelPinning);
108-
return await operation.ExecuteAsync(cancellationContext, binding).ConfigureAwait(false);
108+
return await operation.ExecuteAsync(operationContext, binding).ConfigureAwait(false);
109109
}
110110

111111
public IClientSessionHandle StartImplicitSession()

tests/MongoDB.Driver.Tests/Core/Clusters/LoadBalancedClusterTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ public async Task SelectServer_should_be_cancelled_by_cancellationToken(
387387
Exception exception;
388388
using (var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(100)))
389389
{
390-
var cancellationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationTokenSource.Token);
390+
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationTokenSource.Token);
391391
exception = async ?
392-
await Record.ExceptionAsync(() => subject.SelectServerAsync(cancellationContext, Mock.Of<IServerSelector>())) :
393-
Record.Exception(() => subject.SelectServer(cancellationContext, Mock.Of<IServerSelector>()));
392+
await Record.ExceptionAsync(() => subject.SelectServerAsync(operationContext, Mock.Of<IServerSelector>())) :
393+
Record.Exception(() => subject.SelectServer(operationContext, Mock.Of<IServerSelector>()));
394394
}
395395

396396
exception.Should().BeOfType<OperationCanceledException>();

0 commit comments

Comments
 (0)