From cbbfac0162333c5324180375463f9243d9caeb5a Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Sat, 2 Dec 2023 18:52:30 +0900 Subject: [PATCH] Disable using webdriver --- src/initialization.rs | 2 +- src/main.rs | 128 +++++++++++++++++++++--------------------- 2 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/initialization.rs b/src/initialization.rs index f91cfc3..55eb26b 100644 --- a/src/initialization.rs +++ b/src/initialization.rs @@ -19,7 +19,7 @@ const STRATEGIST_NUMBER: u32 = 16; pub async fn initialization() { println!("- - - initialization start - - -"); - initialize_webdriver().await; + // initialize_webdriver().await; initialize_database().await; println!("- - - initialization done - - -"); } diff --git a/src/main.rs b/src/main.rs index 94aba9c..dac73b3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -936,39 +936,39 @@ async fn main() -> Result<(), Box> { // }); // Task#11: monitoring total market cap - if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL || RUNNING_MODE == TEST { - tokio::task::spawn(async move { - loop { - let result = signal_association::coinmarketcap::market_cap_index().await; - match result { - Ok(T) => { - tx_task11 - .send(11) - .expect("The mpsc channel has been closed."); - } - Err(E) => {} - } - } - }); - } + // if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL || RUNNING_MODE == TEST { + // tokio::task::spawn(async move { + // loop { + // let result = signal_association::coinmarketcap::market_cap_index().await; + // match result { + // Ok(T) => { + // tx_task11 + // .send(11) + // .expect("The mpsc channel has been closed."); + // } + // Err(E) => {} + // } + // } + // }); + // } // Task#12: monitoring foreign exchange rate - if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL { - tokio::task::spawn(async move { - loop { - let result = signal_association::exchange_rate::monitoring_fx_rate_index().await; - match result { - Ok(T) => { - tx_task12 - .send(12) - .expect("The mpsc channel has been closed."); - } - Err(E) => {} - } - sleep(Duration::from_secs(2700)).await; // sleep for 45mins - } - }); - } + // if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL { + // tokio::task::spawn(async move { + // loop { + // let result = signal_association::exchange_rate::monitoring_fx_rate_index().await; + // match result { + // Ok(T) => { + // tx_task12 + // .send(12) + // .expect("The mpsc channel has been closed."); + // } + // Err(E) => {} + // } + // sleep(Duration::from_secs(2700)).await; // sleep for 45mins + // } + // }); + // } // // // Task#13: monitoring dollar index // // tokio::task::spawn(async move { @@ -986,43 +986,43 @@ async fn main() -> Result<(), Box> { // // }); // Task#14: monitoring signal decision - if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL || RUNNING_MODE == TEST { - tokio::task::spawn(async move { - loop { - let result = - signal_association::signal_decision::monitoring_signal_decision().await; - match result { - Ok(T) => { - tx_task14 - .send(14) - .expect("The mpsc channel has been closed."); - } - Err(E) => {} - } + // if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL || RUNNING_MODE == TEST { + // tokio::task::spawn(async move { + // loop { + // let result = + // signal_association::signal_decision::monitoring_signal_decision().await; + // match result { + // Ok(T) => { + // tx_task14 + // .send(14) + // .expect("The mpsc channel has been closed."); + // } + // Err(E) => {} + // } - sleep(Duration::from_millis(500)).await; // sleep for 0.5sec - } - }); - } + // sleep(Duration::from_millis(500)).await; // sleep for 0.5sec + // } + // }); + // } // Task#15: monitoring future ratio - if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL || RUNNING_MODE == TEST { - tokio::task::spawn(async move { - loop { - let result = signal_association::future_ratio::monitoring_future_ratio().await; - match result { - Ok(T) => { - tx_task15 - .send(15) - .expect("The mpsc channel has been closed."); - } - Err(E) => {} - } + // if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL || RUNNING_MODE == TEST { + // tokio::task::spawn(async move { + // loop { + // let result = signal_association::future_ratio::monitoring_future_ratio().await; + // match result { + // Ok(T) => { + // tx_task15 + // .send(15) + // .expect("The mpsc channel has been closed."); + // } + // Err(E) => {} + // } - sleep(Duration::from_secs(60)).await; // sleep for 1min - } - }); - } + // sleep(Duration::from_secs(60)).await; // sleep for 1min + // } + // }); + // } // COEX part // Task#16: execute strategis for buy