File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
apps/price_pusher/src/solana Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -35,20 +35,24 @@ export class SolanaPriceListener extends ChainPriceListener {
3535 // and ensuring it is not older than 30 seconds.
3636 private async checkHealth ( ) {
3737 const slot = await this . pythSolanaReceiver . connection . getSlot ( "finalized" ) ;
38- const blockTime = await this . pythSolanaReceiver . connection . getBlockTime (
39- slot
40- ) ;
41- if (
42- blockTime === null ||
43- blockTime < Date . now ( ) / 1000 - HEALTH_CHECK_TIMEOUT_SECONDS
44- ) {
45- if ( blockTime !== null ) {
46- this . logger . info (
47- `Solana connection is behind by ${
48- Date . now ( ) / 1000 - blockTime
49- } seconds`
50- ) ;
38+ try {
39+ const blockTime = await this . pythSolanaReceiver . connection . getBlockTime (
40+ slot
41+ ) ;
42+ if (
43+ blockTime === null ||
44+ blockTime < Date . now ( ) / 1000 - HEALTH_CHECK_TIMEOUT_SECONDS
45+ ) {
46+ if ( blockTime !== null ) {
47+ this . logger . info (
48+ `Solana connection is behind by ${
49+ Date . now ( ) / 1000 - blockTime
50+ } seconds`
51+ ) ;
52+ }
5153 }
54+ } catch ( err ) {
55+ this . logger . error ( { err } , "checkHealth failed" ) ;
5256 }
5357 }
5458
You can’t perform that action at this time.
0 commit comments