Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
cyq1162 committed Jul 12, 2016
1 parent e1039e8 commit 4d2eb53
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Cache/AutoCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ internal static bool GetCache(AopEnum action, AopInfo aopInfo)//Begin
case AopEnum.Fill:
if (obj != null)
{
aopInfo.Row = ((MDataRow)obj).Clone();
MDataRow row = obj as MDataRow;
if (_MemCache.CacheType == CacheType.LocalCache)
{
row = row.Clone();
}
aopInfo.Row = row;
aopInfo.IsSuccess = true;
}
break;
Expand Down Expand Up @@ -103,6 +108,10 @@ internal static void SetCache(AopEnum action, AopInfo aopInfo)//End
{
return;
}
if (_MemCache.CacheType == CacheType.LocalCache && _MemCache.RemainMemoryPercentage < 15)//可用内存低于15%
{
return;
}
string key = GetKey(action, aopInfo, baseKey);
int flag;//0 正常;1:未识别;2:不允许缓存
SetBaseKeys(aopInfo, key, out flag);//存档Key,后续缓存失效 批量删除
Expand Down Expand Up @@ -219,7 +228,6 @@ private static void SetBaseKey(string baseKey, string key)
_MemCache.Set(baseKey, sb);
}
}

}
private static bool IsCanOperateCache(string baseKey)
{
Expand Down

0 comments on commit 4d2eb53

Please sign in to comment.