From c8ed7da1e2aadd2cd3fdf5f2c784a343d7fe546b Mon Sep 17 00:00:00 2001 From: alexmaek <108730877+alexmaek@users.noreply.github.com> Date: Wed, 6 Jul 2022 08:31:42 +0200 Subject: [PATCH] Take into account failSafeDefaultValue for factory timeout --- src/ZiggyCreatures.FusionCache/FusionCache_Async.cs | 2 +- src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs b/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs index 036a3c95..afe47a73 100644 --- a/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs +++ b/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs @@ -172,7 +172,7 @@ public partial class FusionCache Task? factoryTask = null; - var timeout = options.GetAppropriateFactoryTimeout(memoryEntry is object || distributedEntry is object); + var timeout = options.GetAppropriateFactoryTimeout(memoryEntry is object || distributedEntry is object || failSafeDefaultValue.HasValue); if (_logger?.IsEnabled(LogLevel.Debug) ?? false) _logger.LogDebug("FUSION (O={CacheOperationId} K={CacheKey}): calling the factory (timeout={Timeout})", operationId, key, timeout.ToLogString_Timeout()); diff --git a/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs b/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs index 6d5e8a27..27b5811e 100644 --- a/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs +++ b/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs @@ -172,7 +172,7 @@ public partial class FusionCache Task? factoryTask = null; - var timeout = options.GetAppropriateFactoryTimeout(memoryEntry is object || distributedEntry is object); + var timeout = options.GetAppropriateFactoryTimeout(memoryEntry is object || distributedEntry is object || failSafeDefaultValue.HasValue); if (_logger?.IsEnabled(LogLevel.Debug) ?? false) _logger.LogDebug("FUSION (O={CacheOperationId} K={CacheKey}): calling the factory (timeout={Timeout})", operationId, key, timeout.ToLogString_Timeout());