diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-10 15:51:23 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-10 15:51:23 +0700 |
| commit | 25722cc3ab5ac5afef4d77947f8e2f27355e6837 (patch) | |
| tree | 7184fd0af0129433446f8b195d7683e5494cc402 /indoteknik_custom/models/solr/apache_solr_queue.py | |
| parent | 99e673d2cc5f702cf0a438126ba26d991a3ce6e4 (diff) | |
| parent | b4e74170aeaf00937f78e5af9047218ddb17516c (diff) | |
Merge branch 'production' into cr/auth
# Conflicts:
# indoteknik_custom/__manifest__.py
Diffstat (limited to 'indoteknik_custom/models/solr/apache_solr_queue.py')
| -rw-r--r-- | indoteknik_custom/models/solr/apache_solr_queue.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py index 8dd7c273..07274295 100644 --- a/indoteknik_custom/models/solr/apache_solr_queue.py +++ b/indoteknik_custom/models/solr/apache_solr_queue.py @@ -72,11 +72,12 @@ class ApacheSolrQueue(models.Model): if count == 0: self.create(payload) - def delete_weekly_solr(self, limit=500): + def delete_weekly_solr(self, limit=500, days_after=30): solr = self.search([ ('execute_status', '=', 'success'), - ('execute_date', '>=', (datetime.utcnow() - timedelta(days=7))), + ('execute_date', '>=', (datetime.utcnow() - timedelta(days=days_after))), ], limit=limit) + for rec in solr: rec.unlink() |
