Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/node-core/src/meta/health.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ export class HealthService {

getHealth(): void {
if (this.recordBlockTimestamp && Date.now() - this.recordBlockTimestamp > this.blockTime * 10) {
throw new Error('Endpoint is not healthy');
//check if current processing height reached target height
if (
this.recordBlockHeight &&
this.currentProcessingHeight &&
this.recordBlockHeight !== this.currentProcessingHeight
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.recordBlockHeight !== this.currentProcessingHeight
this.recordBlockHeight <= this.currentProcessingHeight

) {
throw new Error('Endpoint is not healthy');
}
}
if (this.currentProcessingTimestamp && Date.now() - this.currentProcessingTimestamp > this.healthTimeout) {
throw new Error('Indexer is not healthy');
Expand Down