Esempio n. 1
0
        /// <summary>
        /// 将数据读取到缓存
        /// </summary>
        /// <param name="fpath"></param>
        private void ReadToCache(string fpath)
        {
            ILogReader ilr = GetLogReader(fpath);

            if (ilr == null)
            {
                return;
            }
            try
            {
                while (!ilr.EndOfStream)
                {
                    Operation oper = ilr.ReadBlock();
                    if (!string.IsNullOrWhiteSpace(oper.dirs_total))
                    {
                        Cache.Cache.OpersList.Add(oper);
                    }
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.Message);
            }
            finally
            {
                if (ilr != null)
                {
                    ilr.Close();
                }
            }
        }