Skip to content

Commit

Permalink
DataMovement unify TransferAndVerify Part 3 (#39401)
Browse files Browse the repository at this point in the history
* block

* append

* net462 fix

* default timeouts

* test proxy
  • Loading branch information
jaschrep-msft committed Oct 25, 2023
1 parent ef6502f commit a1996d0
Show file tree
Hide file tree
Showing 3 changed files with 325 additions and 424 deletions.
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.DataMovement/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/storage/Azure.Storage.DataMovement",
"Tag": "net/storage/Azure.Storage.DataMovement_0682ba876f"
"Tag": "net/storage/Azure.Storage.DataMovement_d8993077de"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public async Task TransferAndVerifyAsync(
options ??= new DataTransferOptions();
TestEventsRaised testEventsRaised = new TestEventsRaised(options);

if (cancellationToken == default)
{
CancellationTokenSource cts = new();
cts.CancelAfter(TimeSpan.FromSeconds(10));
cancellationToken = cts.Token;
}

DataTransfer transfer = await TransferManager.StartTransferAsync(
sourceResource,
destinationResource,
Expand Down Expand Up @@ -74,6 +81,13 @@ public async Task TransferAndVerifyAsync(
DataTransferOptions options = default,
CancellationToken cancellationToken = default)
{
if (cancellationToken == default)
{
CancellationTokenSource cts = new();
cts.CancelAfter(TimeSpan.FromSeconds(10));
cancellationToken = cts.Token;
}

DataTransfer transfer = await TransferManager.StartTransferAsync(
sourceResource,
destinationResource,
Expand Down
Loading

0 comments on commit a1996d0

Please sign in to comment.