check tokens more aggressively when doing operations
This commit is contained in:
@@ -26,6 +26,7 @@ public sealed class ReceiveOperation(
|
||||
)
|
||||
{
|
||||
using var execute = activityFactory.Start("Receive Operation");
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
execute?.SetTag("receiveInfo", receiveInfo);
|
||||
// 2 - Check account exist
|
||||
Account account = accountService.GetAccountWithServerUrlFallback(receiveInfo.AccountId, receiveInfo.ServerUrl);
|
||||
@@ -34,6 +35,7 @@ public sealed class ReceiveOperation(
|
||||
|
||||
var version = await apiClient.Version.Get(receiveInfo.SelectedVersionId, receiveInfo.ProjectId, cancellationToken);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
var commitObject = await threadContext.RunOnWorkerAsync(
|
||||
() => ReceiveData(account, version, receiveInfo, onOperationProgressed, cancellationToken)
|
||||
);
|
||||
@@ -47,6 +49,7 @@ public sealed class ReceiveOperation(
|
||||
)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
await apiClient.Version.Received(
|
||||
new(version.id, receiveInfo.ProjectId, receiveInfo.SourceApplication),
|
||||
cancellationToken
|
||||
|
||||
@@ -31,8 +31,10 @@ public sealed class SendOperation<T>(
|
||||
CancellationToken ct = default
|
||||
)
|
||||
{
|
||||
ct.ThrowIfCancellationRequested();
|
||||
var buildResult = await rootObjectBuilder.Build(objects, sendInfo, onOperationProgressed, ct);
|
||||
|
||||
ct.ThrowIfCancellationRequested();
|
||||
// POC: Jonathon asks on behalf of willow twin - let's explore how this can work
|
||||
// buildResult.RootObject["@report"] = new Report { ConversionResults = buildResult.ConversionResults };
|
||||
|
||||
@@ -42,6 +44,7 @@ public sealed class SendOperation<T>(
|
||||
var (rootObjId, convertedReferences) = await threadContext.RunOnWorkerAsync(
|
||||
() => Send(buildResult.RootObject, sendInfo, onOperationProgressed, ct)
|
||||
);
|
||||
ct.ThrowIfCancellationRequested();
|
||||
|
||||
return new(rootObjId, convertedReferences, buildResult.ConversionResults);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user