diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-15 10:32:45 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-15 10:32:45 +0700 |
| commit | 4730df5bf97724cd906c8118178407bfbf206bca (patch) | |
| tree | 7d5c418d1049204ecd21b2a5ac8e8cbae354a8ec /indoteknik_custom/models/solr/apache_solr_queue.py | |
| parent | 132d4b80f3d5dad792468bd14961f6a9540122e2 (diff) | |
| parent | 49846bc78d282516092c6c63db63d4ea01d42949 (diff) | |
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
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() |
