This repository was archived by the owner on Jun 11, 2024. It is now read-only.
File tree 2 files changed +23
-19
lines changed
services/blockchain-connector
2 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ config.apiClient = {
127
127
128
128
// Every n milliseconds, verify if client connection is alive
129
129
config . clientConnVerifyInterval =
130
- Number ( process . env . CLIENT_CONNECTION_VERIFY_INTERVAL ) || 30 * 1000 ; // in millisecs
130
+ Number ( process . env . CLIENT_CONNECTION_VERIFY_INTERVAL ) || 60 * 1000 ; // in millisecs
131
131
132
132
// Backdoor config to restart the connector if the stall issue pops up - disabled by default
133
133
const exitDelay = Number ( process . env . CONNECTOR_EXIT_DELAY_IN_HOURS ) ; // in hours
Original file line number Diff line number Diff line change @@ -139,27 +139,31 @@ const ensureAPIClientLiveness = () => {
139
139
140
140
if ( isNodeSynced && isGenesisBlockDownloaded ) {
141
141
setInterval ( async ( ) => {
142
- if ( typeof eventsCounter === 'number' && eventsCounter > 0 ) {
143
- eventsCounter = 0 ;
144
- } else {
145
- if ( typeof eventsCounter !== 'number' ) {
146
- logger . warn (
147
- `eventsCounter ended up with non-numeric value: ${ JSON . stringify (
148
- eventsCounter ,
149
- null ,
150
- '\t' ,
151
- ) } .`,
152
- ) ;
142
+ try {
143
+ if ( typeof eventsCounter === 'number' && eventsCounter > 0 ) {
153
144
eventsCounter = 0 ;
154
- }
145
+ } else {
146
+ if ( typeof eventsCounter !== 'number' ) {
147
+ logger . warn (
148
+ `eventsCounter ended up with non-numeric value: ${ JSON . stringify (
149
+ eventsCounter ,
150
+ null ,
151
+ '\t' ,
152
+ ) } .`,
153
+ ) ;
154
+ eventsCounter = 0 ;
155
+ }
155
156
156
- if ( typeof eventSubscribeClientPoolIndex === 'number' ) {
157
- const apiClient = await getApiClient ( eventSubscribeClientPoolIndex ) ;
158
- Signals . get ( 'resetApiClient' ) . dispatch ( apiClient , true ) ;
159
- logger . debug (
160
- `Dispatched 'resetApiClient' signal for the event subscription API client ${ apiClient . poolIndex } .` ,
161
- ) ;
157
+ if ( typeof eventSubscribeClientPoolIndex === 'number' ) {
158
+ const apiClient = await getApiClient ( eventSubscribeClientPoolIndex ) ;
159
+ Signals . get ( 'resetApiClient' ) . dispatch ( apiClient , true ) ;
160
+ logger . debug (
161
+ `Dispatched 'resetApiClient' signal for the event subscription API client ${ apiClient . poolIndex } .` ,
162
+ ) ;
163
+ }
162
164
}
165
+ } catch ( _ ) {
166
+ // No action required
163
167
}
164
168
} , config . clientConnVerifyInterval ) ;
165
169
} else {
You can’t perform that action at this time.
0 commit comments