mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Deleting quicker.
This commit is contained in:
parent
7e0bef73de
commit
904f0385f6
1 changed files with 2 additions and 6 deletions
|
@ -50,12 +50,8 @@ class MStatistics(mongo.Document):
|
|||
feeds_fetched = MFeedFetchHistory.objects(fetch_date__gte=last_day).count()
|
||||
cls.objects(key='feeds_fetched').update_one(upsert=True, key='feeds_fetched', value=feeds_fetched)
|
||||
|
||||
old_fetch_histories = MFeedFetchHistory.objects(fetch_date__lte=last_day)
|
||||
for history in old_fetch_histories:
|
||||
history.delete()
|
||||
old_page_histories = MPageFetchHistory.objects(fetch_date__lte=last_day)
|
||||
for history in old_page_histories:
|
||||
history.delete()
|
||||
MFeedFetchHistory.objects(fetch_date__lt=last_day).delete()
|
||||
MPageFetchHistory.objects(fetch_date__lt=last_day).delete()
|
||||
|
||||
return feeds_fetched
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue