Beispiel #1
0
 public void CrawlForCompany(long CompanyID)
 {
     try
     {
         this._companyId = CompanyID;
         if ((!_bCheckOtherRunning || !CheckOtherRunning()) && _productAdapter.AllowCrawlFindNew(_companyId))
         {
             if (!_redisWaitCrawler.CheckHaveItemFindNew(_companyId))
             {
                 _redisWaitCrawler.SetNexFindNew(_companyId, 1);
                 var company = new QT.Entities.Company(this._companyId);
                 _redisCacheCompanyCrawler.SetCompanyInfo(_companyId, company.Domain, 24, 24);
             }
             Crawl();
         }
         else
         {
             _redisWaitCrawler.SetNexFindNew(_companyId, 1);
         }
     }
     catch (System.OperationCanceledException)
     {
         if (this._company != null)
         {
             this._redisQueueFindNew.SaveQueue(this._companyId, this._linkQueue.ToArray());
             this._redisWaitCrawler.SetRemoveRunningCrawler(_companyId);
             this._redisWaitCrawler.SetNexFindNew(this._companyId, 1);
             this._redisCrcVisited.SetForCompany(_companyId, new List <long>(this._visitedCrc.Keys));
         }
         throw;
     }
     catch (Exception ex02)
     {
         _log.Error(ex02);
     }
 }