From a2f0010dcee61e1f2957ade1659d454ac2387322 Mon Sep 17 00:00:00 2001 From: Tomas Vyhnal Date: Tue, 7 May 2024 12:06:27 +0200 Subject: [PATCH] Pass cancellation token for recent .net frameworks --- .../NetStandardIDistributedCacheByteArrayProvider.cs | 4 ++-- .../NetStandardIDistributedCacheStringProvider.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Polly.Caching.Distributed/NetStandardIDistributedCacheByteArrayProvider.cs b/src/Polly.Caching.Distributed/NetStandardIDistributedCacheByteArrayProvider.cs index 123c66d..cc01ebc 100644 --- a/src/Polly.Caching.Distributed/NetStandardIDistributedCacheByteArrayProvider.cs +++ b/src/Polly.Caching.Distributed/NetStandardIDistributedCacheByteArrayProvider.cs @@ -56,7 +56,7 @@ public override void Put(string key, byte[] value, Ttl ttl) cancellationToken.ThrowIfCancellationRequested(); byte[] fromCache = await _cache.GetAsync(key -#if NETSTANDARD2_0 +#if NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER , cancellationToken #endif ); @@ -77,7 +77,7 @@ public override Task PutAsync(string key, byte[] value, Ttl ttl, CancellationTok cancellationToken.ThrowIfCancellationRequested(); return _cache.SetAsync(key, value, ttl.ToDistributedCacheEntryOptions() -#if NETSTANDARD2_0 +#if NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER , cancellationToken #endif ); diff --git a/src/Polly.Caching.Distributed/NetStandardIDistributedCacheStringProvider.cs b/src/Polly.Caching.Distributed/NetStandardIDistributedCacheStringProvider.cs index cc8733d..1da024a 100644 --- a/src/Polly.Caching.Distributed/NetStandardIDistributedCacheStringProvider.cs +++ b/src/Polly.Caching.Distributed/NetStandardIDistributedCacheStringProvider.cs @@ -57,7 +57,7 @@ public override void Put(string key, string value, Ttl ttl) cancellationToken.ThrowIfCancellationRequested(); string fromCache = await _cache.GetStringAsync(key -#if NETSTANDARD2_0 +#if NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER , cancellationToken #endif ); @@ -78,7 +78,7 @@ public override Task PutAsync(string key, string value, Ttl ttl, CancellationTok cancellationToken.ThrowIfCancellationRequested(); return _cache.SetStringAsync(key, value, ttl.ToDistributedCacheEntryOptions() -#if NETSTANDARD2_0 +#if NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER , cancellationToken #endif );