예제 #1
0
        private void SendMessageToServiceInsertHistoryDownload(ImageProductInfo imageProductInfo, JobClient historyJobClient)
        {
            var job = new Job
            {
                Data = LogHistoryImageProduct.GetMessage(new LogHistoryImageProduct()
                {
                    ProductId    = imageProductInfo.Id,
                    DateLog      = DateTime.Now,
                    ErrorName    = imageProductInfo.ErrorMessage,
                    IsDownloaded = false,
                    NewsToValid  = false
                })
            };

            while (_isRunning)
            {
                try
                {
                    historyJobClient.PublishJob(job);
                    Log.Info(string.Format("Push message to services insert history download image productid = {0}",
                                           imageProductInfo.Id));
                    break;
                }
                catch (Exception ex)
                {
                    Log.Error(string.Format("ProductId = {0} Push message to services insert history download image.", imageProductInfo.Id), ex);
                    Thread.Sleep(60000);
                }
            }
        }
예제 #2
0
        private void SendMessageToServiceInsertHistoryDownload(LogHistoryImageProduct historyImageProduct, JobClient historyJobClient)
        {
            var job = new Job
            {
                Data = LogHistoryImageProduct.GetMessage(historyImageProduct)
            };

            while (_isRunning)
            {
                try
                {
                    historyJobClient.PublishJob(job);
                    Log.Info(string.Format("Push message to services insert history download image productid = {0}",
                                           historyImageProduct.ProductId));
                    break;
                }
                catch (Exception ex)
                {
                    Log.Error(string.Format("ProductId = {0} Push message to services insert history download image error.", historyImageProduct.ProductId), ex);
                    Thread.Sleep(60000);
                }
            }
        }