mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
delete with etag
This commit is contained in:
parent
c29ae6601f
commit
6d581c57fe
@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Models.Data;
|
||||
using Microsoft.WindowsAzure.Storage;
|
||||
@ -73,7 +74,18 @@ namespace Bit.Core.Repositories.TableStorage
|
||||
|
||||
public async Task DeleteAsync(InstallationDeviceEntity entity)
|
||||
{
|
||||
await _table.ExecuteAsync(TableOperation.Delete(entity));
|
||||
try
|
||||
{
|
||||
entity.ETag = "*";
|
||||
await _table.ExecuteAsync(TableOperation.Delete(entity));
|
||||
}
|
||||
catch(StorageException e)
|
||||
{
|
||||
if(e.RequestInformation.HttpStatusCode != (int)HttpStatusCode.NotFound)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user