mgnsk / FreshRSS-AutoTTL

A FreshRSS extension for automatic feed refresh TTL based on the average frequency of entries.
GNU Affero General Public License v3.0
25 stars 2 forks source link

When only 0/1 entry, fallback to max TTL #1

Closed yzqzss closed 1 year ago

yzqzss commented 1 year ago

When there are no entries in the feed, running app/actualize_script.php on php8.1 will output a lot of deprecated warnings because of getAvgTTL()->calculateEntryAveragePerFeedPerPeriod()->setTimestamp(null).

Deprecated: DateTime::setTimestamp(): Passing null to parameter #1 ($timestamp) of type int is deprecated in /<FreshRSS_DIR>/app/Models/StatsDAO.php on line 229


When there is only 1 entry, getAvgTTL() will actually get Default TTL. If the user uses this plugin and sets Default TTL to a very small value, this may backfire. So fallback to max TTL is better?

mgnsk commented 1 year ago

Acknowledged, I'll take a look.