Esempio n. 1
0
        /// <summary>
        /// 启动本地未索引检查
        /// </summary>
        /// <returns></returns>
        private static int RunCheck()
        {
            CrawlLogic cl = new CrawlLogic();

            cl.Check();                                     //启动本地检查线程
            CrossDispatch cd = new CrossDispatch();
            Thread        tr = new Thread(cd.MonitorCheck); //开始启动检查线程

            tr.Start();
            while (true)
            {
                if (tr.ThreadState == ThreadState.Stopped)   //若线程结束,则检测结束
                {
                    log.Info(DateTime.Now.ToString() + "本地缓存与数据库检测结束");
                    return(1);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 启动删除检查
        /// </summary>
        /// <returns></returns>
        private static int RunDelTest()
        {
            CrawlLogic cl = new CrawlLogic();

            cl.Delete(ConfigValue);                       //启动删除线程
            CrossDispatch cd = new CrossDispatch();
            Thread        tr = new Thread(cd.MonitorDel); //开始监控删除线程

            tr.Start();
            while (true)
            {
                if (tr.ThreadState == ThreadState.Stopped)  //若线程结束,则爬虫结束
                {
                    log.Info(DateTime.Now.ToString() + "删除检查结束");
                    return(1);
                }
            }
        }