Esempio n. 1
0
        private void SaveInsert()
        {
            if (_productWaitInsertGroup.Count <= 0)
            {
                return;
            }
            var lstUpdateToChacheHash = new List <ProductHash>();

            _productAdapter.InsertProductToDb(_productWaitInsertGroup);
            foreach (var product in _productWaitInsertGroup)
            {
                lstUpdateToChacheHash.Add(new ProductHash()
                {
                    HashChange    = product.GetHashChange(),
                    HashDuplicate = product.GetHashCheckDuplicate(),
                    HashImage     = product.GetHashImage(),
                    Id            = product.ID,
                    Price         = product.Price,
                    url           = product.DetailUrl
                });
            }
            _redisProductHash.SetCacheProductHash(_companyId, lstUpdateToChacheHash);
            //_productAdapter.PushMQChangeImage(_productIdWaitChangeImage);
            _log.Info(string.Format("Inserted {0} product", _productWaitInsertGroup.Count));
            _productWaitInsertGroup.Clear();
        }