Skip to content

Commit 948f798

Browse files
Use blob options and remove fake async
1 parent 86781d4 commit 948f798

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/Umbraco.StorageProviders.AzureBlob/IO/AzureBlobFileSystem.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ public void AddFile(string path, Stream stream, bool overrideIfExists)
170170
IfNoneMatch = ETag.All
171171
};
172172

173-
blob.Upload(stream, headers, conditions: conditions);
173+
blob.Upload(stream, new BlobUploadOptions()
174+
{
175+
HttpHeaders = headers,
176+
Conditions = conditions
177+
});
174178
}
175179

176180
/// <inheritdoc />
@@ -192,12 +196,15 @@ public void AddFile(string path, string physicalPath, bool overrideIfExists = tr
192196
{
193197
IfNoneMatch = ETag.All
194198
};
195-
var copyFromUriOperation = destinationBlob.StartCopyFromUri(sourceBlob.Uri, destinationConditions: destinationConditions);
199+
200+
var copyFromUriOperation = destinationBlob.StartCopyFromUri(sourceBlob.Uri, new BlobCopyFromUriOptions()
201+
{
202+
DestinationConditions = destinationConditions
203+
});
204+
196205
if (copyFromUriOperation?.HasCompleted == false)
197206
{
198-
Task.Run(async () => await copyFromUriOperation.WaitForCompletionAsync().ConfigureAwait(false))
199-
.GetAwaiter()
200-
.GetResult();
207+
copyFromUriOperation.WaitForCompletion();
201208
}
202209

203210
if (!copy)

0 commit comments

Comments
 (0)