From 8cd5ba78d36ebb399a69e87aa2bdd76b01bf5504 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 13 Sep 2023 08:56:27 +0700 Subject: Create solr commit collections scheduler --- indoteknik_custom/models/solr/apache_solr.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indoteknik_custom/models/solr/apache_solr.py') diff --git a/indoteknik_custom/models/solr/apache_solr.py b/indoteknik_custom/models/solr/apache_solr.py index 98004f00..eb02cb57 100644 --- a/indoteknik_custom/models/solr/apache_solr.py +++ b/indoteknik_custom/models/solr/apache_solr.py @@ -53,6 +53,10 @@ class ApacheSolr(models.Model): new_dict[cleaned_key] = value return new_dict + def action_commit_collections(self, collections=[]): + for collection in collections: + self.connect(collection).commit(waitFlush=True, waitSearcher=True) + def _update_stock_product_to_solr(self, limit=10000): current_time = datetime.now() delta_time = current_time - timedelta(days=3) -- cgit v1.2.3