From 05a1a92598498779f04a6ea60b2db4553cf52e47 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Mon, 4 Dec 2023 21:40:49 -0800 Subject: [PATCH] use finally --- src/index.ts | 5 +++-- src/publishers/dlobPublisher.ts | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6205ddc..4a1127b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -293,11 +293,12 @@ const main = async () => { .fetch() .then(() => { gpaFetchDurationHistogram.record(Date.now() - startFetch); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - recursiveFetch(); }) .catch(() => { logger.error('Failed to fetch GPA'); + }) + .finally(() => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars recursiveFetch(); }); }, delay); diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 9f7d311..1a3e317 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -235,12 +235,11 @@ const main = async () => { setTimeout(() => { dlobProvider .fetch() - .then(() => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - recursiveFetch(); - }) .catch(() => { logger.error('Failed to fetch GPA'); + }) + .finally(() => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars recursiveFetch(); }); }, delay);