diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-03-30 08:26:57 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-03-30 08:26:57 +0700 |
| commit | 20eebfe836dcd6e971ccd0676b6294a2f3b06e5a (patch) | |
| tree | 3ac71a218b2f4132f19c79c9197728b69416297b | |
| parent | 2b7330d20b56014630097a978934787271754639 (diff) | |
change ip to production, and add log
| -rw-r--r-- | indoteknik_custom/models/apache_solr.py | 11 |
1 files 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) |
