Skip to content

Commit

Permalink
Merge branch '259-node-sync-check' into 'dev'
Browse files Browse the repository at this point in the history
Always check ergo node sync status

Closes #259

See merge request ergo/rosen-bridge/watcher!305
  • Loading branch information
vorujack committed Oct 14, 2024
2 parents 65061cd + 5e7b73f commit 0c120d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-deers-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rosen-bridge/watcher': patch
---

Always check ergo node sync status as health a parameter
18 changes: 9 additions & 9 deletions src/utils/healthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class HealthCheckSingleton {
);
this.healthCheck.register(warnLogHealthCheck);

const ergoNodeSyncCheck = new ErgoNodeSyncHealthCheckParam(
getConfig().healthCheck.ergoNodeMaxHeightDiff,
getConfig().healthCheck.ergoNodeMaxBlockTime,
getConfig().healthCheck.ergoNodeMinPeerCount,
getConfig().healthCheck.ergoNodeMaxPeerHeightDifference,
getConfig().general.nodeUrl
);
this.healthCheck.register(ergoNodeSyncCheck);

if (getConfig().general.scannerType === NODE_TYPE) {
this.registerErgoNodeHealthCheckParams();
} else if (getConfig().general.scannerType === EXPLORER_TYPE) {
Expand Down Expand Up @@ -159,15 +168,6 @@ class HealthCheckSingleton {
getConfig().general.nodeUrl
);
this.healthCheck.register(this.ergoScannerSyncCheckParam);

const ergoNodeSyncCheck = new ErgoNodeSyncHealthCheckParam(
getConfig().healthCheck.ergoNodeMaxHeightDiff,
getConfig().healthCheck.ergoNodeMaxBlockTime,
getConfig().healthCheck.ergoNodeMinPeerCount,
getConfig().healthCheck.ergoNodeMaxPeerHeightDifference,
getConfig().general.nodeUrl
);
this.healthCheck.register(ergoNodeSyncCheck);
};

/**
Expand Down

0 comments on commit 0c120d7

Please sign in to comment.