mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 16:13:26 +08:00
【优化】优化内存缓存【获取所有缓存键】使用方法。
This commit is contained in:
@@ -268,7 +268,10 @@ namespace CoreCms.Net.Caching.SqlSugar
|
|||||||
public List<string> GetCacheKeys()
|
public List<string> GetCacheKeys()
|
||||||
{
|
{
|
||||||
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
|
const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
|
||||||
var entries = Cache.GetType().GetField("_entries", flags).GetValue(Cache);
|
|
||||||
|
var coherentState = Cache.GetType().GetField("_coherentState", flags).GetValue(Cache);
|
||||||
|
var entries = coherentState.GetType().GetField("_entries", flags).GetValue(coherentState);
|
||||||
|
|
||||||
var cacheItems = entries as IDictionary;
|
var cacheItems = entries as IDictionary;
|
||||||
var keys = new List<string>();
|
var keys = new List<string>();
|
||||||
if (cacheItems == null) return keys;
|
if (cacheItems == null) return keys;
|
||||||
|
|||||||
Reference in New Issue
Block a user