17
17
using JR . Stand . Core . Framework . Web . Cache ;
18
18
using JR . Stand . Core . Utils ;
19
19
20
- namespace JR . Cms . Library . CacheProvider . CacheCompoment
20
+ namespace JR . Cms . Library . CacheProvider . CacheComponent
21
21
{
22
22
/// <summary>
23
23
/// Cms注入缓存
@@ -58,6 +58,12 @@ public override object Get(string key)
58
58
return this . cache . Get ( key ) ;
59
59
}
60
60
61
+ public override void Reset ( CmsHandler handler )
62
+ {
63
+ this . cache . Reset ( ) ;
64
+ handler ? . Invoke ( ) ;
65
+ }
66
+
61
67
public override void Insert ( string key , object value )
62
68
{
63
69
cache . Set ( key , value , TimeSpan . Zero ) ;
@@ -87,6 +93,12 @@ public override string Rebuilt()
87
93
//FileInfo file = new FileInfo(cacheDependFile);
88
94
//file.LastWriteTimeUtc = DateTime.UtcNow;
89
95
}
96
+
97
+ /// <inheritdoc />
98
+ public override int GetInt ( string key )
99
+ {
100
+ return this . cache . GetInt ( key ) ;
101
+ }
90
102
}
91
103
92
104
@@ -123,9 +135,8 @@ public T GetCachedResult<T>(string cacheKey, BuiltCacheResultHandler<T> func, Da
123
135
public void Reset ( CmsHandler handler )
124
136
{
125
137
//清除系统缓存
126
- _cacheSha1ETag = _dependCache . Rebuilt ( ) ;
127
-
128
- if ( handler != null ) handler ( ) ;
138
+ _cacheSha1ETag = this . _dependCache . Rebuilt ( ) ;
139
+ this . _dependCache . Reset ( handler ) ;
129
140
}
130
141
131
142
public bool CheckClientCacheExpires ( int seconds )
@@ -187,5 +198,11 @@ public string Rebuilt()
187
198
}
188
199
189
200
#endregion
201
+
202
+ /// <inheritdoc />
203
+ public int GetInt ( string key )
204
+ {
205
+ return this . _dependCache . GetInt ( key ) ;
206
+ }
190
207
}
191
208
}
0 commit comments