Fix empty news feed stopping the feed from ever updating again (#3062)

If a news feed returns an empty file it will cause the feed to only show
the previous entries forever since no new fetch is scheduled.
This commit is contained in:
buxxi 2023-03-11 16:42:13 +01:00 committed by GitHub
parent c6db22524a
commit beea754514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -53,6 +53,7 @@ _This release is scheduled to be released on 2023-04-01._
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
## [2.22.0] - 2023-01-01

View File

@ -72,7 +72,6 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings
parser.on("end", () => {
this.broadcastItems();
scheduleTimer();
});
parser.on("error", (error) => {
@ -80,6 +79,11 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings
scheduleTimer();
});
//"end" event is not broadcast if the feed is empty but "finish" is used for both
parser.on("finish", () => {
scheduleTimer();
});
parser.on("ttl", (minutes) => {
try {
// 86400000 = 24 hours is mentioned in the docs as maximum value: