How to change daemon interval?

Hi!

I want to change the daemon to update every 30 seconds instead of every minute. I added this line to the config.php: “putenv(‘TTRSS_DAEMON_SLEEP_INTERVAL=30’);” and restarted the systemctl of the daemon, but to no avail as it still only updates every minute.

How can I change the interval?

https://git.tt-rss.org/fox/tt-rss/src/branch/master/update_daemon2.php#L175

you can’t go lower.

p.s. in case your next idea would involve adjusting minimum update interval - please change your user agent to something else from tt-rss so the rest of us won’t have to deal with consequences of your ill-thought actions.

Ok thanks for your quick answer!
I won’t be changing it then, it’s not the end of the world having it at a minute but for my use-case I need the results ASAP, that’s why I wanted to decrease every possible factor slowing feed updates down. Although I don’t know how it would hurt other people changing the minimum on my own server…

some people get surprisingly butthurt over one (1) tt-rss HTTP request every 15 minutes and come here to cause a scene. imagine what would happen if tt-rss polled more frequently.

If you need such speed, perhaps there’s a more appropriate method than RSS for your source materials?

It’s [if|when] you [deliberately|mistakenly] use that interval for any other 3rd party feeds to subscribe to and the owner notices and thinks you shouldn’t be hammering their server. Then they start blaming your RSS software and make noises about it.

No there isn’t. I could make my own app from scratch that aggregates the results from the API that my feed uses on a server then sends it to an android app when I refresh in the app, but I don’t have time to make that.

The feeds are all running on my own network. I don’t need any other feeds, and doubt I’d every mistakenly add another feed…

That’s fine. If you understand what you’re doing no one’s going to give you a hard time. People are just mentioning the consequences because site owner’s actually have come here to complain. They’ve also out-right blocked the TT-RSS user agent, which can affect many others.

Yeah I get it, I would be frustrated too if feeds that I use ban the platform I use to read those feeds.

I thought the minimum was 1 minute though, but just found out that’s just for the update daemon, and that won’t update unless the length of the update interval set through the tt-rss settings page has passed (minimum 15 minutes). I added an option in the backend.php to update every minute instead (would doubles instead of integers work here to set it to half a minute for example?), but it’s still just updating every 10 minutes.

there’s a few more queries you’ll need to update.

here’s one - https://git.tt-rss.org/fox/tt-rss/src/branch/master/classes/rssutils.php#L108

Thanks! Already found that but wasn’t sure if that was it.
Do I need to change line 281 of /classes/rpc.php too?

don’t bother. it’s for the so-called simple updates, stuff for shared hosting users, pretty much.

Ok! And I can I set it to half a minute or just whole minutes?

you could replace “… minutes” with “… seconds” in the queries and bump intervals accordingly.

Okay great! Do I need to edit line 205 of update_daemon2.php as well?

And is this right?

I changed the daemon_sleep_interval in config.php, line 176 and 205 in update_daemon2.php, line 108 and 110 in rssutils.php, and $update_intervals / $update_intervals_nodefault in backend.php. It’s now updating about every 90 seconds but still not every 30 seconds.

(two feeds, updated one for one at xx:03:20, xx:03:51, xx:04:27, xx:05:23, xx:05:55, xx:06:56, xx:07:01, xx:08:29, xx:08:38)

i don’t really want to dig too much into this myself, i do have a suggestion though: if the daemon starts new update tasks but no feeds come up, you forgot something in the update_daemon_common() feed selection logic.

if it doesn’t, it’s probably something with the main loop in update_daemon2.php.

you can try update.php --feeds to isolate former from the latter, get to the point where it updates feeds often enough for you, and go from there.

TT-RSS caches feeds. It could be that TT-RSS is updating every 30 seconds but the cache is getting hit during that time.

oh nice catch, @Pizzabroodje that would be rssutils.php line 407.