Skip to content

Commit ad04400

Browse files
authored
fix: increase threshold value (#2077)
* add const * empty
1 parent de25f58 commit ad04400

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

apps/price_pusher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-pusher",
3-
"version": "8.0.3",
3+
"version": "8.0.4",
44
"description": "Pyth Price Pusher",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

apps/price_pusher/src/solana/solana.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { SearcherClient } from "jito-ts/dist/sdk/block-engine/searcher";
1515
import { sliceAccumulatorUpdateData } from "@pythnetwork/price-service-sdk";
1616
import { Logger } from "pino";
1717

18+
const HEALTH_CHECK_TIMEOUT_SECONDS = 60;
19+
1820
export class SolanaPriceListener extends ChainPriceListener {
1921
constructor(
2022
private pythSolanaReceiver: PythSolanaReceiver,
@@ -35,7 +37,17 @@ export class SolanaPriceListener extends ChainPriceListener {
3537
const blockTime = await this.pythSolanaReceiver.connection.getBlockTime(
3638
slot
3739
);
38-
if (blockTime === null || blockTime < Date.now() / 1000 - 50) {
40+
if (
41+
blockTime === null ||
42+
blockTime < Date.now() / 1000 - HEALTH_CHECK_TIMEOUT_SECONDS
43+
) {
44+
if (blockTime !== null) {
45+
this.logger.info(
46+
`Solana connection is behind by ${
47+
Date.now() / 1000 - blockTime
48+
} seconds`
49+
);
50+
}
3951
throw new Error("Solana connection is unhealthy");
4052
}
4153
}

0 commit comments

Comments
 (0)