v2 icon indicating copy to clipboard operation
v2 copied to clipboard

Per feed retention policy

Open shizunge opened this issue 4 years ago • 12 comments

Today there is only one global retention policy, which is controlled by a global parameter CLEANUP_ARCHIVE_READ_DAYS.

For some blogs, I want to keep articles as long as possible. For some news feeds, I do not need to keep many items that long.

It would be great if there is an option let us set per feed retention policy: 1. days to keep, 2. max items to keep.

I think this can be done in two steps:

  1. Add maximum items per feed as a globle retention policy.

    Update the cleanup routine: Iterate all feeds and archive items for each feed. (Like the fresh routines, but this can be done using only 1 worker I think.) Then add a new global parameter: CLEANUP_MAX_READ_ITEMS_PER_FEED to control the max items per feed to keep. Set the parameter to 0 to store unlimited items. (Still subject to CLEANUP_ARCHIVE_READ_DAYS)

  2. Add an option to set per feed retention policy. If not set, use the global policy default. This step probably can be done together with https://github.com/miniflux/miniflux/issues/412 (Fresh frequency setting for single feed)

shizunge avatar Aug 17 '20 02:08 shizunge

I'd like to keep them all forever unless I mark them as read, then they can go away. So maybe have an option to keep them permanently unless otherwise noted.

unwaivering avatar Sep 02 '20 16:09 unwaivering

I'd like to keep them all forever unless I mark them as read, then they can go away. So maybe have an option to keep them permanently unless otherwise noted.

Do you run your instance for a long time? I have hundreds of feeds with a retention rate of 3 years now, and still have a DB of 3GB only, so this sounds a good feature.

somini avatar Sep 03 '20 01:09 somini

I'd like to keep them all forever unless I mark them as read, then they can go away. So maybe have an option to keep them permanently unless otherwise noted.

The cleanup policy should apply to read items only. Unread items should be kept forever. This should be true even in current version.

shizunge avatar Sep 03 '20 01:09 shizunge

Just an FYI I'm using the hosted instance for now.

unwaivering avatar Sep 03 '20 06:09 unwaivering

In the latest version, we had two global config options: CLEANUP_ARCHIVE_READ_DAYS and CLEANUP_ARCHIVE_UNREAD_DAYS. We can set them to -1 to keep all entries.

The original proposal said we want to set the number of entries to keep per feed. It is difficult to write the SQL query. So we can let user to set the number of days to keep (read/unread) per feed, which is easier.

shizunge avatar Jan 09 '21 04:01 shizunge

Is this feature approved to implement? @fguillot

Sleepful avatar Mar 28 '24 23:03 Sleepful

There should just be a global one for all feeds. Why should I ever have to go into the terminal to change that?

unwaivering avatar Mar 30 '24 02:03 unwaivering

In other words, it should just continue to persist the way it is.

unwaivering avatar Mar 30 '24 02:03 unwaivering

@shizunge how does it look like with this feature? I find it extremely important for my feed since I am following multiple sources with differing posting frequency — some post multiple times per hour and some once per two weeks — and this feature bugs me.

I am willing to look into it. Would it be accepted if I do?

Kairixir avatar Apr 09 '24 14:04 Kairixir

I don't have time on it right now.

I believe we need to

  1. Update database scheme to store the new user configuration. at internal/database/migrations.go
  2. The cleanup codes go to runCleanupTasks
  3. UI updates

I am also thinking that probably we should only let user set a shorter retention period (than the global ones) to avoid users abuse the system. Then we should also support unlimited global retention policy (e.g. CLEANUP_ARCHIVE_READ_DAYS=-1 or something similar)

shizunge avatar Apr 10 '24 06:04 shizunge

Awesome, thanks for guidance :)

I'll try my best

Kairixir avatar Apr 13 '24 16:04 Kairixir

(context: I have miniflux deployed on my RPi and I'm sole user).

As in the original message - it would be awesome to mark some feeds as "retain forever" (mostly those "low traffic", to have complete archive). Currently for those low traffic feeds I simply mark all entries with star but it's not really convenient and it may slip by me sometime thus a feed-option "keep items forever" would be very welcomed.

woj-tek avatar May 03 '24 14:05 woj-tek