mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Handling missing cutoff_date.
This commit is contained in:
parent
4a82e187c3
commit
a998efaf6c
2 changed files with 8 additions and 7 deletions
|
@ -122,15 +122,16 @@ class UserSubscription(models.Model):
|
|||
if not feed_ids:
|
||||
return story_hashes
|
||||
|
||||
read_dates = dict()
|
||||
for us in usersubs:
|
||||
read_dates[us.feed_id] = int(max(us.mark_read_date, cutoff_date).strftime('%s'))
|
||||
current_time = int(time.time() + 60*60*24)
|
||||
if not cutoff_date:
|
||||
cutoff_date = datetime.datetime.now() - datetime.timedelta(days=settings.DAYS_OF_STORY_HASHES)
|
||||
unread_timestamp = int(time.mktime(cutoff_date.timetuple()))-1000
|
||||
feed_counter = 0
|
||||
|
||||
read_dates = dict()
|
||||
for us in usersubs:
|
||||
read_dates[us.feed_id] = int(max(us.mark_read_date, cutoff_date).strftime('%s'))
|
||||
|
||||
for feed_id_group in chunks(feed_ids, 20):
|
||||
pipeline = r.pipeline()
|
||||
for feed_id in feed_id_group:
|
||||
|
|
|
@ -910,16 +910,16 @@ class MSocialSubscription(mongo.Document):
|
|||
if not subscription_user_ids:
|
||||
return story_hashes
|
||||
|
||||
read_dates = dict()
|
||||
for us in socialsubs:
|
||||
read_dates[us.subscription_user_id] = int(max(us.mark_read_date, cutoff_date).strftime('%s'))
|
||||
|
||||
current_time = int(time.time() + 60*60*24)
|
||||
if not cutoff_date:
|
||||
cutoff_date = datetime.datetime.now() - datetime.timedelta(days=settings.DAYS_OF_STORY_HASHES)
|
||||
unread_timestamp = int(time.mktime(cutoff_date.timetuple()))-1000
|
||||
feed_counter = 0
|
||||
|
||||
read_dates = dict()
|
||||
for us in socialsubs:
|
||||
read_dates[us.subscription_user_id] = int(max(us.mark_read_date, cutoff_date).strftime('%s'))
|
||||
|
||||
for sub_user_id_group in chunks(subscription_user_ids, 20):
|
||||
pipeline = r.pipeline()
|
||||
for sub_user_id in sub_user_id_group:
|
||||
|
|
Loading…
Add table
Reference in a new issue