mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Tightening compute scores times.
This commit is contained in:
parent
8d482077ad
commit
28f5be041e
1 changed files with 4 additions and 3 deletions
|
@ -10,6 +10,7 @@ from apps.analyzer.models import apply_classifier_titles, apply_classifier_feeds
|
||||||
|
|
||||||
DAYS_OF_UNREAD = 14
|
DAYS_OF_UNREAD = 14
|
||||||
MONTH_AGO = datetime.datetime.now() - datetime.timedelta(days=30)
|
MONTH_AGO = datetime.datetime.now() - datetime.timedelta(days=30)
|
||||||
|
WEEK_AGO = datetime.datetime.now() - datetime.timedelta(days=7)
|
||||||
|
|
||||||
class UserSubscription(models.Model):
|
class UserSubscription(models.Model):
|
||||||
"""
|
"""
|
||||||
|
@ -49,13 +50,13 @@ class UserSubscription(models.Model):
|
||||||
self.unread_count_positive = 0
|
self.unread_count_positive = 0
|
||||||
self.unread_count_neutral = 0
|
self.unread_count_neutral = 0
|
||||||
self.unread_count_updated = max(now, latest_story_date)
|
self.unread_count_updated = max(now, latest_story_date)
|
||||||
self.needs_unread_relcalc = False
|
self.needs_unread_recalc = False
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def calculate_feed_scores(self, silent=False):
|
def calculate_feed_scores(self, silent=False):
|
||||||
if self.user.profile.last_seen_on < MONTH_AGO:
|
if self.user.profile.last_seen_on < WEEK_AGO:
|
||||||
if not silent:
|
if not silent:
|
||||||
logging.info(' ---> [%s] SKIPPING Computing scores: %s (1 month+)' % (self.user, self.feed))
|
logging.info(' ---> [%s] SKIPPING Computing scores: %s (1 week+)' % (self.user, self.feed))
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.feed.fetched_once:
|
if not self.feed.fetched_once:
|
||||||
|
|
Loading…
Add table
Reference in a new issue