1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-24 21:11:04 -05:00

delete with etag

This commit is contained in:
Kyle Spearrin 2019-03-19 21:41:24 -04:00
parent c29ae6601f
commit 6d581c57fe

View File

@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Models.Data; using Bit.Core.Models.Data;
using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage;
@ -73,7 +74,18 @@ namespace Bit.Core.Repositories.TableStorage
public async Task DeleteAsync(InstallationDeviceEntity entity) 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;
}
}
} }
} }
} }