From 20eebfe836dcd6e971ccd0676b6294a2f3b06e5a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Thu, 30 Mar 2023 08:26:57 +0700 Subject: change ip to production, and add log --- indoteknik_custom/models/apache_solr.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py index d957f4bb..16cf5908 100644 --- a/indoteknik_custom/models/apache_solr.py +++ b/indoteknik_custom/models/apache_solr.py @@ -13,14 +13,16 @@ class ApacheSolr(models.Model): def _sync_product_to_solr(self): _logger.info('run sync to solr...') - solr = pysolr.Solr('http://192.168.23.5:8983/solr/product/', timeout=100) + solr = pysolr.Solr('http://10.148.0.5:8983/solr/product/', timeout=100) templates = self.env['product.template'].search([ - ('solr_flag', '=', 0), + ('solr_flag', '=', 0), # ('id', '=', 21560) - ], limit=5000) + ], limit=500) document = [] + counter = 0 for template in templates: + counter += 1 price_excl_after_disc = price_excl = 0 variants_name = variants_code = '' if template.product_variant_count > 1: @@ -64,4 +66,5 @@ class ApacheSolr(models.Model): })] solr.add(document) # add counter for monitoring - print(template.id) + _logger.info('%s / 500' % counter) + _logger.info('Success add to solr product %s' % template.id) -- cgit v1.2.3