Move collection data type into loop

This commit is contained in:
Sik Yoon 2023-12-02 20:03:41 +09:00
parent cbbfac0162
commit c6df1ac360

View File

@ -404,13 +404,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut serverhealth = ServerHealth::new();
let mut prev_server_epoch: u128 = 0;
let mut epoch_difference: f64 = 0.0;
let mut epoch_difference_vec: Vec<f64> = Vec::new();
let mut epoch_mean: f64 = 0.0;
let mut elapsed_time: u128 = 0;
loop {
let instant = Instant::now();
let mut epoch_difference_vec: Vec<f64> = Vec::new();
// let mut usertime_mutex = usertime_arc.lock().await;
// server_health_check_team::execute_server_health_check(&mut usertime_mutex).await;
// time_checking_team::execute_time_check(&mut usertime_mutex).await;
@ -1029,10 +1028,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL {
tokio::task::spawn(async move {
sleep(Duration::from_secs(40)).await;
let mut all_data = AllData::new();
let mut elapsed_time = 0;
loop {
let instant = Instant::now();
let mut all_data = AllData::new();
all_data.valid_symbol_vec = rx3_valid_usdt_trade_vec.borrow().clone();
// realtime price data
@ -1102,12 +1101,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
if RUNNING_MODE == REAL || RUNNING_MODE == SIMUL {
tokio::task::spawn(async move {
sleep(Duration::from_secs(40)).await;
let mut all_data = AllData::new();
let mut exchange_info_vec: Vec<ExchangeInfo> = Vec::new();
let mut trade_fee_vec: Vec<TradeFee> = Vec::new();
let mut elapsed_time = 0;
loop {
let instant = Instant::now();
let mut all_data = AllData::new();
let mut exchange_info_vec: Vec<ExchangeInfo> = Vec::new();
let mut trade_fee_vec: Vec<TradeFee> = Vec::new();
all_data.valid_symbol_vec = rx4_valid_usdt_trade_vec.borrow().clone();
exchange_info_vec = rx6_exchange_info_data.borrow().clone();
trade_fee_vec = rx5_tradefee_vec.borrow().clone();
@ -1391,10 +1391,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Task#24: monitoring_scoreboard
tokio::task::spawn(async move {
let mut elapsed_time = 0;
let mut all_data = AllData::new();
loop {
let instant = Instant::now();
let mut all_data = AllData::new();
// realtime price data
all_data.rt_price_1m_vec = rx4_rt_price_1m_vec.borrow().clone();