mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
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:
parent
c6db22524a
commit
beea754514
@ -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)
|
- 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 precipitation css styles and rounding value
|
||||||
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
|
- 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
|
## [2.22.0] - 2023-01-01
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings
|
|||||||
|
|
||||||
parser.on("end", () => {
|
parser.on("end", () => {
|
||||||
this.broadcastItems();
|
this.broadcastItems();
|
||||||
scheduleTimer();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
parser.on("error", (error) => {
|
parser.on("error", (error) => {
|
||||||
@ -80,6 +79,11 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings
|
|||||||
scheduleTimer();
|
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) => {
|
parser.on("ttl", (minutes) => {
|
||||||
try {
|
try {
|
||||||
// 86400000 = 24 hours is mentioned in the docs as maximum value:
|
// 86400000 = 24 hours is mentioned in the docs as maximum value:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user