1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

add x-platform support with netcore 2.0

This commit is contained in:
Kyle Spearrin
2017-07-31 16:58:27 -04:00
parent d6d9ceab87
commit 3880edfb79
12 changed files with 80 additions and 25 deletions

View File

@ -98,24 +98,50 @@ namespace Bit.Core.Services
public async Task CleanupAsync(Guid cipherId)
{
await InitAsync();
foreach(var blob in _attachmentsContainer.ListBlobs($"temp/{cipherId}", true))
var segment = await _attachmentsContainer.ListBlobsSegmentedAsync($"temp/{cipherId}", true,
BlobListingDetails.None, 100, null, null, null);
while(true)
{
if(blob is CloudBlockBlob blockBlob)
foreach(var blob in segment.Results)
{
await blockBlob.DeleteIfExistsAsync();
if(blob is CloudBlockBlob blockBlob)
{
await blockBlob.DeleteIfExistsAsync();
}
}
if(segment.ContinuationToken == null)
{
break;
}
segment = await _attachmentsContainer.ListBlobsSegmentedAsync(segment.ContinuationToken);
}
}
public async Task DeleteAttachmentsForCipherAsync(Guid cipherId)
{
await InitAsync();
foreach(var blob in _attachmentsContainer.ListBlobs(cipherId.ToString(), true))
var segment = await _attachmentsContainer.ListBlobsSegmentedAsync(cipherId.ToString(), true,
BlobListingDetails.None, 100, null, null, null);
while(true)
{
if(blob is CloudBlockBlob blockBlob)
foreach(var blob in segment.Results)
{
await blockBlob.DeleteIfExistsAsync();
if(blob is CloudBlockBlob blockBlob)
{
await blockBlob.DeleteIfExistsAsync();
}
}
if(segment.ContinuationToken == null)
{
break;
}
segment = await _attachmentsContainer.ListBlobsSegmentedAsync(segment.ContinuationToken);
}
}