File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @pythnetwork/price-pusher" ,
3
- "version" : " 8.0.3 " ,
3
+ "version" : " 8.0.4 " ,
4
4
"description" : " Pyth Price Pusher" ,
5
5
"homepage" : " https://pyth.network" ,
6
6
"main" : " lib/index.js" ,
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import { SearcherClient } from "jito-ts/dist/sdk/block-engine/searcher";
15
15
import { sliceAccumulatorUpdateData } from "@pythnetwork/price-service-sdk" ;
16
16
import { Logger } from "pino" ;
17
17
18
+ const HEALTH_CHECK_TIMEOUT_SECONDS = 60 ;
19
+
18
20
export class SolanaPriceListener extends ChainPriceListener {
19
21
constructor (
20
22
private pythSolanaReceiver : PythSolanaReceiver ,
@@ -35,7 +37,17 @@ export class SolanaPriceListener extends ChainPriceListener {
35
37
const blockTime = await this . pythSolanaReceiver . connection . getBlockTime (
36
38
slot
37
39
) ;
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
+ }
39
51
throw new Error ( "Solana connection is unhealthy" ) ;
40
52
}
41
53
}
You can’t perform that action at this time.
0 commit comments