Poll once immediately

Otherwise errors will be delayed
This commit is contained in:
Lynn Smeria 2020-03-18 20:16:36 +02:00
parent 660cf9c1e3
commit dccb7512f8

View file

@ -41,7 +41,7 @@ const convertRecentEventDatesToDelta = () => {
}, {});
};
setInterval(async () => {
const poll = async () => {
const { events, seenIds } = await fetchNewEvents(state.seenIds);
const hooks = await collectHooks();
const monitoredFolders = new Set(hooks.map(x => x.folder));
@ -80,4 +80,7 @@ setInterval(async () => {
});
state.seenIds = seenIds;
}, 30000);
};
setInterval(poll, 30000);
poll();