From f698a3b63f4ad1ef9c5f06a8d139a4e38f1b3553 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Fri, 22 Mar 2019 10:21:10 +0300 Subject: [PATCH] DistributedCache cleanup --- .../Volo/Abp/Caching/DistributedCache.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs index 477b0c764b..f65683042b 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; @@ -70,11 +69,12 @@ namespace Volo.Abp.Caching } catch (Exception ex) { - if ((bool) hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); return null; } + throw; } @@ -94,11 +94,14 @@ namespace Volo.Abp.Caching try { - cachedBytes = await Cache.GetAsync(NormalizeKey(key), CancellationTokenProvider.FallbackToProvider(token)); + cachedBytes = await Cache.GetAsync( + NormalizeKey(key), + CancellationTokenProvider.FallbackToProvider(token) + ); } catch (Exception ex) { - if ((bool)hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); return null; @@ -185,7 +188,7 @@ namespace Volo.Abp.Caching } catch (Exception ex) { - if ((bool) hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); return; @@ -210,7 +213,7 @@ namespace Volo.Abp.Caching } catch (Exception ex) { - if ((bool)hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); return; @@ -230,7 +233,7 @@ namespace Volo.Abp.Caching } catch (Exception ex) { - if ((bool) hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); return; @@ -250,7 +253,7 @@ namespace Volo.Abp.Caching } catch (Exception ex) { - if ((bool)hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); return; @@ -270,7 +273,7 @@ namespace Volo.Abp.Caching } catch (Exception ex) { - if ((bool) hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); } @@ -289,7 +292,7 @@ namespace Volo.Abp.Caching } catch (Exception ex) { - if ((bool)hideErrors) + if (hideErrors == true) { Logger.LogException(ex, LogLevel.Warning); return;