Skip to content

Commit

Permalink
+ (CMS) Fix issue where WebsiteLavaTemplateCache returns an error and…
Browse files Browse the repository at this point in the history
… cannot be cleared. (Fixes SparkDevNetwork#5250)
  • Loading branch information
courtneycooksey committed Jan 23, 2023
1 parent 335140e commit 2af43b7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Rock/Web/Cache/RockCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static List<CacheKeyReference> ObjectCacheKeyReferences
{
_objectCacheKeyReferences = value;
}
}
}
private static List<CacheKeyReference> _objectCacheKeyReferences = new List<CacheKeyReference>();

/// <summary>
Expand All @@ -184,8 +184,10 @@ public static List<CacheKeyReference> StringCacheKeyReferences
}
return _stringCacheKeyReferences;
}
set {
_stringCacheKeyReferences = value; }
set
{
_stringCacheKeyReferences = value;
}
}
private static List<CacheKeyReference> _stringCacheKeyReferences = new List<CacheKeyReference>();

Expand Down Expand Up @@ -276,8 +278,8 @@ public static object GetOrAddExisting( string key, string region, Func<object> i
Expiration = expiration,
AllowCacheBypass = false
};
return GetOrAddExisting(args);

return GetOrAddExisting( args );
}

/// <summary>
Expand Down Expand Up @@ -426,7 +428,7 @@ public static void AddOrUpdate( string key, string region, object obj, TimeSpan
}

var value = RockCacheManager<List<string>>.Instance.Get( cacheTag, CACHE_TAG_REGION_NAME ) ?? new List<string>();
if ( !value.Contains(key) )
if ( !value.Contains( key ) )
{
value.Add( key );
RockCacheManager<List<string>>.Instance.AddOrUpdate( cacheTag, CACHE_TAG_REGION_NAME, value );
Expand Down Expand Up @@ -539,7 +541,7 @@ public static string ClearCachedItemsForType( string cacheTypeName )

if ( cacheTypeName.Contains( "Cache" ) )
{
return ClearCachedItemsForType( Type.GetType( $"Rock.Web.Cache.{cacheTypeName},Rock" ) );
return ClearCachedItemsForType( Type.GetType( cacheTypeName ) );
}

return ClearCachedItemsForSystemType( cacheTypeName );
Expand Down Expand Up @@ -726,11 +728,11 @@ public static bool IsEndPointAvailable( string socket, string password )
{
configurationOptions.Password = password;
}

var redisConnection = StackExchange.Redis.ConnectionMultiplexer.Connect( configurationOptions );
return redisConnection.IsConnected;
}
catch(Exception)
catch ( Exception )
{
return false;
}
Expand Down

0 comments on commit 2af43b7

Please sign in to comment.