B2018-099: Print all & Approve all of large set crashes with out of memory error
This commit is contained in:
@@ -631,20 +631,20 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public partial class PartInfo
|
||||
{
|
||||
public static List<int> CacheList
|
||||
public static HashSet<int> CacheList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!CSLACache.RestoreCache) return null;
|
||||
ConvertListToDictionary();
|
||||
List<int> lst = new List<int>();
|
||||
HashSet<int> lst = new HashSet<int>();
|
||||
foreach (string key in _CacheByPrimaryKey.Keys)
|
||||
foreach (PartInfo pi in _CacheByPrimaryKey[key])
|
||||
lst.Add(pi.MyPartInfoUnique);
|
||||
return lst;
|
||||
}
|
||||
}
|
||||
public static void RestoreCacheList(List<int> cacheList)
|
||||
public static void RestoreCacheList(HashSet<int> cacheList)
|
||||
{
|
||||
if (cacheList == null) return;
|
||||
ConvertListToDictionary();
|
||||
@@ -667,28 +667,31 @@ namespace VEPROMS.CSLA.Library
|
||||
#region Restore Cache
|
||||
public partial class ContentInfo
|
||||
{
|
||||
public static List<int> CacheList
|
||||
// B2018-099: CacheLists where changed from List<int> to HashSet<int> because use for preventing out of memory errors
|
||||
// was very slow when using List (HashSets are faster for large lists). The ContentInfo, ItemInfo and PartInfo
|
||||
// CacheLists were changed.
|
||||
public static HashSet<int> CacheList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!CSLACache.RestoreCache) return null;
|
||||
ConvertListToDictionary();
|
||||
List<int> lst = new List<int>();
|
||||
HashSet<int> lst = new HashSet<int>();
|
||||
foreach (string key in _CacheByPrimaryKey.Keys)
|
||||
foreach (ContentInfo ci in _CacheByPrimaryKey[key])
|
||||
lst.Add(ci.MyContentInfoUnique);
|
||||
return lst;
|
||||
}
|
||||
}
|
||||
public static void RestoreCacheList(List<int> cacheList)
|
||||
public static void RestoreCacheList(HashSet<int> cacheList)
|
||||
{
|
||||
if (cacheList == null) return;
|
||||
if (cacheList == null) return; // if 'initialized' through CacheList above, it won't be null.
|
||||
ConvertListToDictionary();
|
||||
List<ContentInfo> ciList = new List<ContentInfo>();
|
||||
foreach (string key in _CacheByPrimaryKey.Keys)
|
||||
foreach (string key in _CacheByPrimaryKey.Keys) // KBR THIS is what takes so long for contents!
|
||||
foreach (ContentInfo ci in _CacheByPrimaryKey[key])
|
||||
{
|
||||
if (!cacheList.Contains(ci.MyContentInfoUnique))
|
||||
if (!cacheList.Contains(ci.MyContentInfoUnique))
|
||||
ciList.Add(ci);
|
||||
}
|
||||
while (ciList.Count > 0)
|
||||
@@ -769,20 +772,20 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public partial class ItemInfo
|
||||
{
|
||||
public static List<int> CacheList
|
||||
public static HashSet<int> CacheList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!CSLACache.RestoreCache) return null;
|
||||
ConvertListToDictionary();
|
||||
List<int> lst = new List<int>();
|
||||
HashSet<int> lst = new HashSet<int>();
|
||||
foreach (string key in _CacheByPrimaryKey.Keys)
|
||||
foreach (ItemInfo ii in _CacheByPrimaryKey[key])
|
||||
lst.Add(ii.MyItemInfoUnique);
|
||||
return lst;
|
||||
}
|
||||
}
|
||||
public static void RestoreCacheList(List<int> cacheList)
|
||||
public static void RestoreCacheList(HashSet<int> cacheList)
|
||||
{
|
||||
if (cacheList == null) return;
|
||||
ConvertListToDictionary();
|
||||
|
Reference in New Issue
Block a user