From 0fd79ff3423ba9f43b201939bbb73f5dd42ea17b Mon Sep 17 00:00:00 2001 From: Samika Kashyap Date: Fri, 31 May 2024 12:59:20 -0700 Subject: [PATCH] chore: fix for read replica --- src/services/request-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/request-service.ts b/src/services/request-service.ts index cce379e6..2a7ad1fb 100644 --- a/src/services/request-service.ts +++ b/src/services/request-service.ts @@ -91,9 +91,9 @@ export class RequestService { logger.err(`Error fetching request from replica db for ${cid}, error: ${e}`) } if (!found) { - found = await this.requestRepository.findByCid(cid) logger.debug(`Request not found in replica db for ${cid}, fetching from main_db`) Metrics.count(METRIC_NAMES.REPLICA_DB_REQUEST_NOT_FOUND, 1) + found = await this.requestRepository.findByCid(cid) if (!found) { throw new RequestDoesNotExistError(cid) }