@@ -97,6 +97,9 @@ pub struct Config {
9797 /// Age after which a price update is considered stale and not published
9898 #[ serde( with = "humantime_serde" ) ]
9999 pub staleness_threshold : Duration ,
100+ /// RPC timeout for the requests to the RPC for sending price updates and monitoring them
101+ #[ serde( with = "humantime_serde" ) ]
102+ pub rpc_timeout : Duration ,
100103 /// Maximum size of a batch
101104 pub max_batch_size : usize ,
102105 /// Capacity of the channel between the Exporter and the Transaction Monitor
@@ -117,6 +120,7 @@ impl Default for Config {
117120 refresh_network_state_interval_duration : Duration :: from_millis ( 200 ) ,
118121 publish_interval_duration : Duration :: from_secs ( 1 ) ,
119122 staleness_threshold : Duration :: from_secs ( 5 ) ,
123+ rpc_timeout : Duration :: from_secs ( 10 ) ,
120124 max_batch_size : 12 ,
121125 inflight_transactions_channel_capacity : 10000 ,
122126 transaction_monitor : Default :: default ( ) ,
@@ -214,7 +218,7 @@ impl Exporter {
214218 ) -> Self {
215219 let publish_interval = time:: interval ( config. publish_interval_duration ) ;
216220 Exporter {
217- rpc_client : RpcClient :: new ( rpc_url. to_string ( ) ) ,
221+ rpc_client : RpcClient :: new_with_timeout ( rpc_url. to_string ( ) , config . rpc_timeout ) ,
218222 config,
219223 publish_interval,
220224 key_store,
0 commit comments