Disable using webdriver
This commit is contained in:
parent
70e6b7c690
commit
cbbfac0162
|
|
@ -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 - - -");
|
||||
}
|
||||
|
|
|
|||
128
src/main.rs
128
src/main.rs
|
|
@ -936,39 +936,39 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
// });
|
||||
|
||||
// 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<dyn std::error::Error>> {
|
|||
// // });
|
||||
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user