File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
app-libs/oracle/src/oracle_sources Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ use itc_rest_client::{
2929 RestGet , RestPath ,
3030} ;
3131use lazy_static:: lazy_static;
32+ use log:: debug;
3233use serde:: { Deserialize , Serialize } ;
3334use std:: {
3435 collections:: HashMap ,
@@ -42,7 +43,7 @@ const COINGECKO_URL: &str = "https://api.coingecko.com";
4243const COINGECKO_PARAM_CURRENCY : & str = "vs_currency" ;
4344const COINGECKO_PARAM_COIN : & str = "ids" ;
4445const COINGECKO_PATH : & str = "api/v3/coins/markets" ;
45- const COINGECKO_TIMEOUT : Duration = Duration :: from_secs ( 3u64 ) ;
46+ const COINGECKO_TIMEOUT : Duration = Duration :: from_secs ( 5u64 ) ;
4647const COINGECKO_ROOT_CERTIFICATE : & str = include_str ! ( "../certificates/lets_encrypt_root_cert.pem" ) ;
4748
4849lazy_static ! {
@@ -111,6 +112,7 @@ impl<OracleSourceInfo: Into<TradingInfo>> OracleSource<OracleSourceInfo> for Coi
111112 )
112113 . map_err ( Error :: RestClient ) ?;
113114
115+ debug ! ( "coingecko received response: {:#?}" , & response) ;
114116 let list = response. 0 ;
115117 if list. is_empty ( ) {
116118 return Err ( Error :: NoValidData ( COINGECKO_URL . to_string ( ) , trading_pair. key ( ) ) )
Original file line number Diff line number Diff line change @@ -110,9 +110,13 @@ impl Send for SendWithCertificateVerification {
110110 request : & mut Request ,
111111 writer : & mut Vec < u8 > ,
112112 ) -> Result < Response , Error > {
113- request
114- . send_with_pem_certificate ( writer, Some ( self . root_certificate . to_string ( ) ) )
115- . map_err ( Error :: HttpReqError )
113+ match request. send_with_pem_certificate ( writer, Some ( self . root_certificate . to_string ( ) ) ) {
114+ Ok ( response) => Ok ( response) ,
115+ Err ( e) => {
116+ error ! ( "SendWithCertificateVerification::execute_send_request received error: {:#?}" , & e) ;
117+ Err ( Error :: HttpReqError ( e) )
118+ } ,
119+ }
116120 }
117121}
118122
@@ -237,7 +241,7 @@ where
237241 . read_timeout ( self . timeout )
238242 . write_timeout ( self . timeout ) ;
239243
240- trace ! ( "{:?}" , request) ;
244+ trace ! ( "request is: {:?}" , request) ;
241245
242246 let mut writer = Vec :: new ( ) ;
243247
You can’t perform that action at this time.
0 commit comments