Skip to content

Commit

Permalink
fix: count instead of record metric
Browse files Browse the repository at this point in the history
  • Loading branch information
stephhuynh18 committed Jun 19, 2024
1 parent 2d9c3db commit 68d1be7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/anchor-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ export class AnchorService {
// TODO: Remove for CAS V2 as we won't need to move PENDING requests to ready. Switch to using anchorReadyRequests.
async anchorRequests(abortOptions?: AbortOptions): Promise<boolean> {
const timeout = setTimeout(() => {
Metrics.record(METRIC_NAMES.ANCHOR_TAKING_TOO_LONG, 1)
Metrics.count(METRIC_NAMES.ANCHOR_TAKING_TOO_LONG, 1)
}, this.alertOnLongAnchorMs)

abortOptions?.signal?.addEventListener('abort', () => {
clearTimeout(timeout)
})

if (this.useQueueBatches) {
const results = await this.anchorNextQueuedBatch(abortOptions)
const batchAnchored = await this.anchorNextQueuedBatch(abortOptions)
clearTimeout(timeout)
return results
return batchAnchored
} else {
const readyRequestsCount = await this.requestRepository.countByStatus(RS.READY)

Expand Down

0 comments on commit 68d1be7

Please sign in to comment.