Skip to content
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

question about "items_lifetime" #1480

Open
herrxyz opened this issue Apr 8, 2024 · 4 comments
Open

question about "items_lifetime" #1480

herrxyz opened this issue Apr 8, 2024 · 4 comments
Labels

Comments

@herrxyz
Copy link

herrxyz commented Apr 8, 2024

hey there,
I don't think I really understand what "items_lifetime" does. According to documentation, "Number of days since the item has been last seen after which it can be deleted. Set to 0 to disable item deletion. Starred items will never be deleted.".
I thought this means that items / articles gets deleted after this time, for example after 30 days. I expected that after setting this number to 15 and pressing "update", a lot of old articles would get deleted and therefore the number of articles would get lower (number of articles shown in webinterface didnt change).
Please explain what this parameter exactly does and, if possible, how to delete old articles (selfoss is getting slow after several years)
using https://hub.docker.com/r/rsprta/selfoss but migrated my years old sqlite-db into this image

@jtojnar
Copy link
Member

jtojnar commented Apr 8, 2024

Hi. I feel your pain. My selfoss.db is 434 MB and selfoss is pretty sluggish for me.

The articles should indeed get deleted after the update finishes. Just note that the configuration value refers to the number of days since the article was last seen in the feed. So if the feed still contains the article, it will not be removed because it would likely just be re-added on the next update.

I double checked by reducing the limit from 1000 to 30 on a copy of my database and it indeed deleted most of the items (and reduced the file size to 29 MB). You should be able to verify with the following command – it will print counts of items grouped by date they were last seen (as date|age|count):

$ sqlite3 data/sqlite/selfoss.db 'select date(lastseen), cast(julianday(date()) - julianday(date(lastseen)) as int), count(*) from items where starred = false group by date(lastseen)'

Unfortunately, I do not think there is currently much to do other than trying to remove some feeds.

I have optimizing the database on my to-do list for 2.20 but I now only have access to my main computer at weekends so I am not sure when I will be able to tackle it.

@JayVii
Copy link

JayVii commented Aug 8, 2024

Maybe only somewhat related, please excuse if this is the wrong issue for this.

Is it possible that items_lifetime also has an effect on which items get fetched? I set up a new selfoss instance,set items_lifetime=0, imported an .opml and let it fetch the feeds. It fetched very few items. Looking at the logs, it said that for most feeds there were no items younger than 0 days. Setting items_lifetime=365 changed this and it fetched (most) of the remaining items...

@jtojnar
Copy link
Member

jtojnar commented Aug 8, 2024

@JayVii If you use selfoss 2.19, it just compares the items_lifetime with the item age and remove the item if the age is greater than or equal (so for zero, it will remove all items). The upcoming 2.20 adds zero as a special case that will disable the garbage collection.

I really need to finish 2.20. Though with my current schedule, I probably won’t get around it until autumn. Feel free to use the development builds until then.

@JayVii
Copy link

JayVii commented Aug 9, 2024

Hey @jtojnar thanks for the swift response. Alright, then this was a misunderstanding, or more so, the documentation is already ahead a little bit:

items_lifetime

Number of days since the item has been last seen after which it can be deleted. Set to 0 to disable item deletion. Starred items will never be deleted.

I was just a bit confused and stumbled upon this issue after trying to get it to work for a while. I set it to 3650 (~10 years) for now and will be patient for 2.2.0. Take your time and take care!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants