From 760c42a23aa4b1674df3a27592d40d0ee83dd0b6 Mon Sep 17 00:00:00 2001 From: zinniawang149 Date: Tue, 12 Mar 2024 22:45:27 +1100 Subject: [PATCH] Support different read mode in RedisHybridCacheClient (#83) * Support different read mode in RedisHybridCacheClient * Trigger license check * Trigger the check (revert) --------- Co-authored-by: Zinnia Wang --- src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs | 6 ++++++ src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs b/src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs index 98c35fe..35328dc 100644 --- a/src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs +++ b/src/Foundatio.Redis/Cache/RedisCacheClientOptions.cs @@ -31,5 +31,11 @@ public RedisCacheClientOptionsBuilder ShouldThrowOnSerializationError(bool shoul Target.ShouldThrowOnSerializationError = shouldThrow; return this; } + + public RedisCacheClientOptionsBuilder ReadMode(CommandFlags commandFlags) + { + Target.ReadMode = commandFlags; + return this; + } } } diff --git a/src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs b/src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs index 7a2d0f7..d450f71 100644 --- a/src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs +++ b/src/Foundatio.Redis/Cache/RedisHybridCacheClient.cs @@ -10,7 +10,8 @@ public RedisHybridCacheClient(RedisHybridCacheClientOptions options, InMemoryCac .ConnectionMultiplexer(options.ConnectionMultiplexer) .Serializer(options.Serializer) .LoggerFactory(options.LoggerFactory) - .ShouldThrowOnSerializationError(options.ShouldThrowOnSerializationError)), + .ShouldThrowOnSerializationError(options.ShouldThrowOnSerializationError) + .ReadMode(options.ReadMode)), new RedisMessageBus(o => o .Subscriber(options.ConnectionMultiplexer.GetSubscriber()) .Topic(options.RedisChannelName)