From 456ead9bc8b0f61357bae93152ad0403c4940101 Mon Sep 17 00:00:00 2001 From: vnugent Date: Tue, 13 Feb 2024 14:46:35 -0500 Subject: fix: #1 shared cluster index on linux & latested core updates --- .../src/BlobCacheExtensions.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs') diff --git a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs index 4cacb3f..1681256 100644 --- a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs +++ b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs @@ -252,11 +252,27 @@ namespace VNLib.Data.Caching.ObjectCache /// The id of the object to delete /// A token to cancel the async lock await /// A task that completes when the item has been deleted - public static async ValueTask DeleteObjectAsync(this IBlobCacheTable table, string objectId, CancellationToken cancellation = default) + public static ValueTask DeleteObjectAsync(this IBlobCacheTable table, string objectId, CancellationToken cancellation = default) { + ArgumentNullException.ThrowIfNull(table); + //Try to get the bucket that the id should belong to IBlobCacheBucket bucket = table.GetBucket(objectId); + return DeleteObjectAsync(bucket, objectId, cancellation); + } + + /// + /// Asynchronously deletes a previously stored item + /// + /// + /// The id of the object to delete + /// A token to cancel the async lock await + /// A task that completes when the item has been deleted + public static async ValueTask DeleteObjectAsync(this IBlobCacheBucket bucket, string objectId, CancellationToken cancellation = default) + { + ArgumentNullException.ThrowIfNull(bucket); + //Wait for the bucket IBlobCache cache = await bucket.ManualWaitAsync(cancellation); -- cgit