mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Adding cutoff from trimming stories for memory profiling.
This commit is contained in:
parent
92f48a0821
commit
78547af24b
1 changed files with 2 additions and 2 deletions
|
@ -1547,10 +1547,10 @@ class Feed(models.Model):
|
|||
self.save_popular_authors(feed_authors=feed_authors[:-1])
|
||||
|
||||
@classmethod
|
||||
def trim_old_stories(cls, start=0, verbose=True, dryrun=False, total=0):
|
||||
def trim_old_stories(cls, start=0, verbose=True, dryrun=False, total=0, end=None):
|
||||
now = datetime.datetime.now()
|
||||
month_ago = now - datetime.timedelta(days=settings.DAYS_OF_STORY_HASHES)
|
||||
feed_count = Feed.objects.latest('pk').pk
|
||||
feed_count = end or Feed.objects.latest('pk').pk
|
||||
|
||||
for feed_id in range(start, feed_count):
|
||||
if feed_id % 1000 == 0:
|
||||
|
|
Loading…
Add table
Reference in a new issue