Poll once immediately
Otherwise errors will be delayed
This commit is contained in:
parent
660cf9c1e3
commit
dccb7512f8
7
index.js
7
index.js
|
@ -41,7 +41,7 @@ const convertRecentEventDatesToDelta = () => {
|
||||||
}, {});
|
}, {});
|
||||||
};
|
};
|
||||||
|
|
||||||
setInterval(async () => {
|
const poll = async () => {
|
||||||
const { events, seenIds } = await fetchNewEvents(state.seenIds);
|
const { events, seenIds } = await fetchNewEvents(state.seenIds);
|
||||||
const hooks = await collectHooks();
|
const hooks = await collectHooks();
|
||||||
const monitoredFolders = new Set(hooks.map(x => x.folder));
|
const monitoredFolders = new Set(hooks.map(x => x.folder));
|
||||||
|
@ -80,4 +80,7 @@ setInterval(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
state.seenIds = seenIds;
|
state.seenIds = seenIds;
|
||||||
}, 30000);
|
};
|
||||||
|
|
||||||
|
setInterval(poll, 30000);
|
||||||
|
poll();
|
||||||
|
|
Loading…
Reference in a new issue