Fixing error where lock could not be taken on build folder
This commit is contained in:
parent
19ec330c20
commit
3e690cbbf6
2 changed files with 17 additions and 1 deletions
|
@ -125,6 +125,20 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
}
|
||||
|
||||
public void CreateBlobIfNotExists(string path)
|
||||
{
|
||||
System.Threading.Tasks.Task<bool> task = _blobContainer.GetBlockBlobReference(path).ExistsAsync();
|
||||
task.Wait();
|
||||
if (!task.Result)
|
||||
{
|
||||
CloudBlockBlob blob = _blobContainer.GetBlockBlobReference(path);
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
blob.UploadFromStreamAsync(ms).Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteBlob(string path)
|
||||
{
|
||||
_blobContainer.GetBlockBlobReference(path).DeleteAsync().Wait();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue