mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-23 09:49:52 +00:00
WebUI: avoid queuing up requests
`setInterval()` will always fire a new timeout regardless previous `updateRssFeedList()` has completed or not. This patch will now wait for previous request to complete before another timeout.
This commit is contained in:
parent
69a829dfb0
commit
6b52a04ff1
@ -180,7 +180,7 @@
|
||||
const serverSyncRssDataInterval = 1500;
|
||||
let feedData = {};
|
||||
let pathByFeedId = new Map();
|
||||
let feedRefreshTimer;
|
||||
let feedRefreshTimer = -1;
|
||||
const rssFeedTable = new window.qBittorrent.DynamicTable.RssFeedTable();
|
||||
const rssArticleTable = new window.qBittorrent.DynamicTable.RssArticleTable();
|
||||
|
||||
@ -293,11 +293,15 @@
|
||||
};
|
||||
|
||||
const unload = () => {
|
||||
clearInterval(feedRefreshTimer);
|
||||
clearTimeout(feedRefreshTimer);
|
||||
feedRefreshTimer = -1;
|
||||
};
|
||||
|
||||
const load = () => {
|
||||
feedRefreshTimer = setInterval(updateRssFeedList, serverSyncRssDataInterval);
|
||||
feedRefreshTimer = setTimeout(() => {
|
||||
updateRssFeedList();
|
||||
load();
|
||||
}, serverSyncRssDataInterval);
|
||||
};
|
||||
|
||||
const addRSSFeed = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user