diff options
author | vnugent <public@vaughnnugent.com> | 2024-02-14 14:23:53 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-02-14 14:23:53 -0500 |
commit | 6b87785026ca57d6f41cff87ddbd066362f3cacc (patch) | |
tree | 74cddbca5eebcec7948e706bd7b742b19e55eeb6 /plugins/VNLib.Data.Caching.Providers.Redis | |
parent | c0e2a71b7b4081117d87c2c34c1b2afb8d511732 (diff) |
Squashed commit of the following:
commit 456ead9bc8b0f61357bae93152ad0403c4940101
Author: vnugent <public@vaughnnugent.com>
Date: Tue Feb 13 14:46:35 2024 -0500
fix: #1 shared cluster index on linux & latested core updates
commit a481d63f964a5d5204cac2e95141f37f9a28d573
Author: vnugent <public@vaughnnugent.com>
Date: Tue Jan 23 15:43:50 2024 -0500
cache extension api tweaks
Diffstat (limited to 'plugins/VNLib.Data.Caching.Providers.Redis')
-rw-r--r-- | plugins/VNLib.Data.Caching.Providers.Redis/src/RedisClientCacheEntry.cs | 14 | ||||
-rw-r--r-- | plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/plugins/VNLib.Data.Caching.Providers.Redis/src/RedisClientCacheEntry.cs b/plugins/VNLib.Data.Caching.Providers.Redis/src/RedisClientCacheEntry.cs index f80c750..360be58 100644 --- a/plugins/VNLib.Data.Caching.Providers.Redis/src/RedisClientCacheEntry.cs +++ b/plugins/VNLib.Data.Caching.Providers.Redis/src/RedisClientCacheEntry.cs @@ -211,8 +211,8 @@ namespace VNLib.Data.Caching.Providers.Redis ///<inheritdoc/> public async Task AddOrUpdateAsync<T>(string key, string? newKey, T value, ICacheObjectSerializer serialzer, CancellationToken cancellation) { - _ = key ?? throw new ArgumentNullException(nameof(key)); - _ = serialzer ?? throw new ArgumentNullException(nameof(serialzer)); + ArgumentException.ThrowIfNullOrWhiteSpace(key); + ArgumentNullException.ThrowIfNull(serialzer); //Alloc update buffer using AddOrUpdateBuffer buffer = new(_defaultHeap, InitialWriterBufferSize, false); @@ -231,7 +231,7 @@ namespace VNLib.Data.Caching.Providers.Redis } ///<inheritdoc/> - public async Task AddOrUpdateAsync<T>(string key, string? newKey, ObjectDataReader<T> callback, T state, CancellationToken cancellation) + public async Task AddOrUpdateAsync<T>(string key, string? newKey, ObjectDataGet<T> callback, T state, CancellationToken cancellation) { /* * Because the redis database only allows ReadonlyMemory when @@ -253,7 +253,7 @@ namespace VNLib.Data.Caching.Providers.Redis await _database.KeyRenameAsync(key, newKey); } - static IMemoryOwner<byte> AllocAndCopy(ObjectDataReader<T> callback, T state, IUnmangedHeap heap, ref int length) + static IMemoryOwner<byte> AllocAndCopy(ObjectDataGet<T> callback, T state, IUnmangedHeap heap, ref int length) { //Get the buffer from the callback ReadOnlySpan<byte> data = callback(state); @@ -276,7 +276,8 @@ namespace VNLib.Data.Caching.Providers.Redis ///<inheritdoc/> public async Task<T?> GetAsync<T>(string key, ICacheObjectDeserializer deserializer, CancellationToken cancellation) { - _ = deserializer ?? throw new ArgumentNullException(nameof(deserializer)); + ArgumentException.ThrowIfNullOrWhiteSpace(key); + ArgumentNullException.ThrowIfNull(deserializer); //Try to get the value from the cache RedisValue value = await _database.StringGetAsync(key); @@ -293,7 +294,8 @@ namespace VNLib.Data.Caching.Providers.Redis ///<inheritdoc/> public async Task GetAsync<T>(string key, ObjectDataSet<T> callback, T state, CancellationToken cancellation) { - _ = callback ?? throw new ArgumentNullException(nameof(callback)); + ArgumentException.ThrowIfNullOrWhiteSpace(key); + ArgumentNullException.ThrowIfNull(callback); //Try to get the value from the cache RedisValue value = await _database.StringGetAsync(key); diff --git a/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj b/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj index dd2d9ca..c71ee72 100644 --- a/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj +++ b/plugins/VNLib.Data.Caching.Providers.Redis/src/VNLib.Data.Caching.Providers.Redis.csproj @@ -39,7 +39,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="StackExchange.Redis" Version="2.7.10" /> + <PackageReference Include="StackExchange.Redis" Version="2.7.17" /> </ItemGroup> <ItemGroup> |