Skip to content

Commit 395068a

Browse files
fix(calendar): prevent excessive fetching on client reload
- Only trigger `fetchCalendar()` when creating a new fetcher instance - When reusing an existing fetcher, broadcast cached events without forcing a new fetch - Prevents hitting rate limits (fix(calendar): prevent excessive fetching on client reload
1 parent d507aba commit 395068a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/default/calendar/node_helper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@ module.exports = NodeHelper.create({
7070
});
7171

7272
this.fetchers[identifier + url] = fetcher;
73+
fetcher.fetchCalendar();
7374
} else {
7475
Log.log(`Use existing calendarfetcher for url: ${url}`);
7576
fetcher = this.fetchers[identifier + url];
7677
fetcher.broadcastEvents();
7778
}
78-
79-
fetcher.fetchCalendar();
8079
},
8180

8281
/**

0 commit comments

Comments
 (0)