catch gpa fail

This commit is contained in:
Nour Alharithi
2023-12-04 21:35:16 -08:00
parent 5996143a5a
commit c4059d3ca0
2 changed files with 28 additions and 9 deletions

View File

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