try catch
This commit is contained in:
parent
a04b54ce99
commit
a4d5e5d768
1 changed files with 8 additions and 4 deletions
|
@ -9,10 +9,14 @@
|
||||||
|
|
||||||
// Pooling interval to fetch entries every 31 seconds
|
// Pooling interval to fetch entries every 31 seconds
|
||||||
interval = setInterval(async () => {
|
interval = setInterval(async () => {
|
||||||
|
try {
|
||||||
const promise = fetchEntries();
|
const promise = fetchEntries();
|
||||||
// wait for the promise to resolve before assigning to prevent flash
|
// wait for the promise to resolve before assigning to prevent flash
|
||||||
await promise;
|
await promise;
|
||||||
entriesPromise = promise;
|
entriesPromise = promise;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching entries:', error);
|
||||||
|
}
|
||||||
}, 1000 * 31);
|
}, 1000 * 31);
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
|
|
Loading…
Add table
Reference in a new issue