From 0fa7d9c956a7424049357bd92df40c8f3a654af3 Mon Sep 17 00:00:00 2001 From: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> Date: Mon, 20 May 2024 19:01:14 -0400 Subject: [PATCH] chore: extra worker logs --- src/services/anchor-service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/anchor-service.ts b/src/services/anchor-service.ts index cddae573..d0ecc982 100644 --- a/src/services/anchor-service.ts +++ b/src/services/anchor-service.ts @@ -217,7 +217,9 @@ export class AnchorService { } try { - logger.imp(`Anchoring ${batchMessage.data.rids.length} requests from batch ${batchMessage.data.bid}`) + logger.imp( + `Anchoring ${batchMessage.data.rids.length} requests from batch ${batchMessage.data.bid}` + ) const requests = await this.requestRepository.findByIds(batchMessage.data.rids) const requestsNotReplaced = requests.filter( @@ -585,6 +587,7 @@ export class AnchorService { anchors.length > 0 ? await this.anchorRepository.withConnection(trx).createAnchors(anchors) : 0 + logger.imp(`Persisted ${persistedAnchorsCount} anchors to the database`) await this.requestRepository.withConnection(trx).updateRequests( { @@ -594,12 +597,14 @@ export class AnchorService { }, acceptedRequests ) + logger.imp(`Updated ${acceptedRequests.length} requests to COMPLETED status`) // record some metrics about the timing and count of anchors const completed = new TimeableMetric(SinceField.CREATED_AT) completed.recordAll(acceptedRequests) completed.publishStats(METRIC_NAMES.CREATED_SUCCESS_MS) Metrics.count(METRIC_NAMES.ACCEPTED_REQUESTS, acceptedRequests.length) + logger.imp('Published metrics for completed requests') return persistedAnchorsCount }, { isolationLevel: 'repeatable read' }