Skip to content

Commit c5f9050

Browse files
authored
[calendar] deny fetch interval < 60000 and set 60000 in this case (prevent fetch loop failed) (#3382)
Hi, I had the case of some users who set a very small fetchinterval (10 sec for example) in some cases, it may be that the request did not have time to complete correctly and that the next one has already been sent (generally on start of MM²) I think that lock min fetchInterval to 60000 is a good idea
1 parent 16af809 commit c5f9050

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ _This release is scheduled to be released on 2024-04-01._
3838
- Ignore all custom css files (#3359)
3939
- [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361)
4040
- Changed `log.debug` to `log.log` in `app.js` where logLevel is not set because config is not loaded at this time (#3353)
41+
- [calandar] deny fetch interval < 60000 and set 60000 in this case (prevent fetch loop failed) (#3382)
4142
- added message in case where config.js is missing the module.export line PR #3383
4243
- Fixed an issue where recurring events could extend past their recurrence end date (#3393)
4344
- Don't display any `npm WARN <....>` on install (#3399)

modules/default/calendar/node_helper.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ module.exports = NodeHelper.create({
4747
}
4848

4949
let fetcher;
50+
let fetchIntervalCorrected;
5051
if (typeof this.fetchers[identifier + url] === "undefined") {
51-
Log.log(`Create new calendarfetcher for url: ${url} - Interval: ${fetchInterval}`);
52-
fetcher = new CalendarFetcher(url, fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, broadcastPastEvents, selfSignedCert);
52+
if (fetchInterval < 60000) {
53+
Log.warn(`fetchInterval for url ${url} must be >= 60000`);
54+
fetchIntervalCorrected = 60000;
55+
}
56+
Log.log(`Create new calendarfetcher for url: ${url} - Interval: ${fetchIntervalCorrected || fetchInterval}`);
57+
fetcher = new CalendarFetcher(url, fetchIntervalCorrected || fetchInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, broadcastPastEvents, selfSignedCert);
5358

5459
fetcher.onReceive((fetcher) => {
5560
this.broadcastEvents(fetcher, identifier);

0 commit comments

Comments
 (0)