use finally

This commit is contained in:
Nour Alharithi
2023-12-04 21:40:49 -08:00
parent c4059d3ca0
commit 05a1a92598
2 changed files with 6 additions and 6 deletions

View File

@@ -293,11 +293,12 @@ const main = async () => {
.fetch() .fetch()
.then(() => { .then(() => {
gpaFetchDurationHistogram.record(Date.now() - startFetch); gpaFetchDurationHistogram.record(Date.now() - startFetch);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
recursiveFetch();
}) })
.catch(() => { .catch(() => {
logger.error('Failed to fetch GPA'); logger.error('Failed to fetch GPA');
})
.finally(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
recursiveFetch(); recursiveFetch();
}); });
}, delay); }, delay);

View File

@@ -235,12 +235,11 @@ const main = async () => {
setTimeout(() => { setTimeout(() => {
dlobProvider dlobProvider
.fetch() .fetch()
.then(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
recursiveFetch();
})
.catch(() => { .catch(() => {
logger.error('Failed to fetch GPA'); logger.error('Failed to fetch GPA');
})
.finally(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
recursiveFetch(); recursiveFetch();
}); });
}, delay); }, delay);