Esempio n. 1
0
 public void PushQueueIndexCompany(long CompanyID)
 {
     try
     {
         var updateProductJob = new Websosanh.Core.JobServer.Job();
         updateProductJob.Data = BitConverter.GetBytes(CompanyID);
         int updateProductJobExpirationMS = 3600000;
         updateProductJobClient_PushCompany.PublishJob(updateProductJob, updateProductJobExpirationMS);
     }
     catch (Exception ex01)
     {
         log.Error(string.Format("Error push job ChangeMainInfo to MQ:{0}.{1}", ex01.Message, ex01.StackTrace));
         Thread.Sleep(10000);
     }
 }
Esempio n. 2
0
 public void PushProductToQueueChangeImage(long ProductID)
 {
     while (true)
     {
         try
         {
             var jobMQ = new Websosanh.Core.JobServer.Job();
             jobMQ.Data = BitConverter.GetBytes(ProductID);
             jobMQ.Type = (int)TypeJobWithRabbitMQ.Product;
             jobClient_ProductChangeImage.PublishJob(jobMQ, updateProductJobExpirationMS);
             return;
         }
         catch (Exception ex01)
         {
             log.Error(string.Format("Error push job ChangeMainInfo to MQ:{0}.{1}", ex01.Message, ex01.StackTrace));
             Thread.Sleep(10000);
         }
     }
 }
Esempio n. 3
0
 public void PushCompanyToQueue(TaskCrawlerCompany taskCrawlerCompany)
 {
     while (true)
     {
         try
         {
             var jobMQ = new Websosanh.Core.JobServer.Job();
             jobMQ.Data = System.Text.Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(taskCrawlerCompany));
             jobMQ.Type = (int)TypeJobWithRabbitMQ.Product;
             jobClient_ProductChangeImage.PublishJob(jobMQ, 100000000);
             return;
         }
         catch (Exception ex01)
         {
             log.Error(string.Format("Error push job ChangeMainInfo to MQ:{0}.{1}", ex01.Message, ex01.StackTrace));
             Thread.Sleep(10000);
         }
     }
 }
Esempio n. 4
0
 public void PushProductToQueueWaitChange(Product _product)
 {
     while (true)
     {
         try
         {
             var jobMQ = new Websosanh.Core.JobServer.Job();
             jobMQ.Data = Product.GetMess(_product);
             jobMQ.Type = (int)TypeJobWithRabbitMQ.Product;
             updateProductJobClient_ChangeImage.PublishJob(jobMQ, 0);
             return;
         }
         catch (Exception ex01)
         {
             log.Error(string.Format("Error push job ChangeMainInfo to MQ:{0}.{1}", ex01.Message, ex01.StackTrace));
             Thread.Sleep(10000);
         }
     }
 }
Esempio n. 5
0
 public void PushQueueChangeChangeImage(MqChangeImage mss)
 {
     while (true)
     {
         try
         {
             var jobMq = new Websosanh.Core.JobServer.Job
             {
                 Data = MqChangeImage.GetMess(mss),
                 Type = (int)TypeJobWithRabbitMQ.Product
             };
             base.PublishJob(jobMq, 0);
             return;
         }
         catch (Exception ex01)
         {
             _log.Error(string.Format("Error push job ChangeMainInfo to MQ:{0}.{1}", ex01.Message, ex01.StackTrace));
             Thread.Sleep(10000);
         }
     }
 }
Esempio n. 6
0
 public void PushQueueProcessAfterChangeProduct(List <Product> lstProductChangeNeedUpdate)
 {
     foreach (var itemProductChanged in lstProductChangeNeedUpdate)
     {
         while (true)
         {
             try
             {
                 var updateProductJob = new Websosanh.Core.JobServer.Job();
                 updateProductJob.Data = BitConverter.GetBytes(itemProductChanged.ID);
                 jobclient_ProductChangeData.PublishJob(updateProductJob, updateProductJobExpirationMS);
                 break;
             }
             catch (Exception ex01)
             {
                 log.Error(string.Format("Error push job ChangeMainInfo to MQ:{0}.{1}", ex01.Message, ex01.StackTrace));
                 Thread.Sleep(10000);
             }
         }
     }
 }
Esempio n. 7
0
        public void PushQueueReloadCacheDuplicate(long CompanyID, string Domain)
        {
            try
            {
                JobClient jobClientReloadCacheProductInfo = new JobClient("CacheCrawlerProduct", GroupType.Topic, "CacheCrawlerProduct.Refresh.CheckDuplicate.#", true, this.rabbitMQServer);
                QT.Entities.CrawlerProduct.RabbitMQ.MssRefreshCacheProductInfo mss = new Entities.CrawlerProduct.RabbitMQ.MssRefreshCacheProductInfo()
                {
                    CompanyID = CompanyID,
                    Domain    = Domain
                };

                var updateProductJob = new Websosanh.Core.JobServer.Job();
                updateProductJob.Data = System.Text.Encoding.UTF8.GetBytes(mss.GetMss());
                int updateProductJobExpirationMS = 3600000;
                jobClientReloadCacheProductInfo.PublishJob(updateProductJob, updateProductJobExpirationMS);
            }
            catch (Exception ex01)
            {
                _log.Error(string.Format("Error push job ChangeMainInfo to MQ:{0}.{1}", ex01.Message, ex01.StackTrace));
                Thread.Sleep(10000);
            }
        }