- BlackList에 5분 적용

This commit is contained in:
2016-07-25 04:05:45 +09:00
parent f5af5eaef3
commit 3fb2c4adbe

View File

@@ -20,6 +20,18 @@ namespace upper_limit_crawler
public float m_fLossCut;
}
public struct BLACKLIST
{
public BLACKLIST(string strCode, int iTime)
{
m_strCode = strCode;
m_iTime = iTime;
}
public string m_strCode;
public int m_iTime;
}
public class ULDataMgr
{
public SETTING m_Setting = new SETTING();
@@ -27,7 +39,7 @@ namespace upper_limit_crawler
ULTrader m_Trader = new ULTrader();
Dictionary<string, ULWatchItem> m_WatchList = new Dictionary<string, ULWatchItem>();
List<string> m_BlackList = new List<string>();
List<BLACKLIST> m_BlackList = new List<BLACKLIST>();
public ULDataMgr()
{
@@ -99,12 +111,20 @@ namespace upper_limit_crawler
public void AddBlackList(string strCode)
{
m_BlackList.Add(strCode);
int iTime = int.Parse(UlUtil.GetCurTime().ToString("HHmmss"));
BLACKLIST black = new BLACKLIST(strCode, iTime);
m_BlackList.Add(black);
}
bool IsIn5Min(int iTime)
{
int iCurTime = int.Parse(UlUtil.GetCurTime().ToString("HHmmss"));
return (iTime >= iCurTime - 500);
}
public bool IsInBlackList(string strCode)
{
return m_BlackList.Contains(strCode);
return m_BlackList.Any(r => r.m_strCode == strCode && IsIn5Min(r.m_iTime));
}
public Dictionary<string, ULWatchItem> GetWatchList()