Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,21 @@ protected override async Task DeleteAsync(SnapshotMetadata metadata)
cts.CancelAfter(_settings.RequestTimeout);
using (cts)
{
await blobClient.DeleteIfExistsAsync(cancellationToken: cts.Token);
if (metadata.Timestamp == DateTime.MinValue)
{
// Short-circuit the timestamp query if the metadata does not require us to check for timestamp
await blobClient.DeleteIfExistsAsync(cancellationToken: cts.Token);
}
else
{
var response = await blobClient.GetPropertiesAsync(cancellationToken: cts.Token);
if (response.HasValue)
{
var timestamp = new DateTime(long.Parse(response.Value.Metadata[TimeStampMetaDataKey]));
if(timestamp <= metadata.Timestamp)
await blobClient.DeleteAsync(cancellationToken: cts.Token);
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AkkaVersion>1.5.26</AkkaVersion>
<AkkaVersion>1.5.28</AkkaVersion>
<AkkaHostingVersion>1.5.25</AkkaHostingVersion>
</PropertyGroup>
<!-- App dependencies -->
Expand Down