-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: use reader.get_entry_counts() and limit= for better efficiency #16
Comments
Hey @lemon24 It would be nice if there was a method to mark all entries as read for a feed in one go. Is this possible? Something like: |
Hmmm, unless I'm missing something here, I need to read all the feed entries into memory anyways if the feed is newly added? |
@lemon24, I think I definitely have a strong use-case for this. If there was a method such as this, I wouldn't have to read all the entries into memory. I could just limit to 5 as you suggest and use this method to mark them all read. |
I'm a bit reluctant to add exactly that, since both in the case above, and in a similar case in the reader web app, it'd cause a race condition – if the feed is updated after the get_entries() call, new entries would be mistakenly marked as read. If I ever add batch methods for performance, I'll keep this in mind, though. |
Ah I see, I didn't think of that! Guess it's fine for now though 🙂 thanks! |
(Found this while looking at your code for lemon24/reader#206 (comment) and thought it might be helpful, feel free to ignore me. :)
In check_feeds(), you can use get_entry_counts() and
limit=
to avoid reading all the entries in memory.It should be possible to rewrite this:
Like this:
Also,
feed.last_updated is None
is likely a more reliable way of checking if a feed is new.The text was updated successfully, but these errors were encountered: