Skip to content

Commit

Permalink
Port akkadotnet/akka.net#7313: Made DateTime.UtcNow the default tim…
Browse files Browse the repository at this point in the history
…estamp for `SnapshotMetdata`
  • Loading branch information
Arkatufus committed Sep 11, 2024
1 parent 5ad7a15 commit 916d18b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,13 @@ protected override async Task DeleteAsync(SnapshotMetadata metadata)
cts.CancelAfter(_settings.RequestTimeout);
using (cts)
{
await blobClient.DeleteIfExistsAsync(cancellationToken: cts.Token);
var response = await blobClient.DownloadAsync(cts.Token);
if (response.HasValue)
{
var timestamp = new DateTime(long.Parse(response.Value.Details.Metadata[TimeStampMetaDataKey]));
if(timestamp <= metadata.Timestamp)
await blobClient.DeleteAsync(cancellationToken: cts.Token);
}
}
}

Expand Down

0 comments on commit 916d18b

Please sign in to comment.