Apply cargo formatter
This commit is contained in:
parent
f9c6f0dce1
commit
0779d3794f
|
|
@ -43,7 +43,8 @@ pub async fn set_unit_usdt() {
|
|||
&& asset_info.current_total_usdt < dec!(2000.0)
|
||||
{
|
||||
// set_unit_trade_usdt = dec!(150.0); // $150 for each trade
|
||||
set_unit_trade_usdt = decimal_mul(asset_info.current_total_usdt, dec!(0.1)); // 10% of total usdt
|
||||
set_unit_trade_usdt = decimal_mul(asset_info.current_total_usdt, dec!(0.1));
|
||||
// 10% of total usdt
|
||||
} else if dec!(2000.0) <= asset_info.current_total_usdt
|
||||
&& asset_info.current_total_usdt < dec!(5000.0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use reqwest::{Client, ClientBuilder};
|
|||
use rust_decimal::{prelude::FromPrimitive, prelude::ToPrimitive, Decimal, RoundingStrategy};
|
||||
use rust_decimal_macros::dec;
|
||||
use sqlx::FromRow;
|
||||
use std::{io, io::Write, process::Stdio, path::Path};
|
||||
use std::{io, io::Write, path::Path, process::Stdio};
|
||||
use tokio::{fs::*, io::ErrorKind, process::Command, task::JoinHandle, time::*};
|
||||
|
||||
const STRATEGIST_NUMBER: u32 = 16;
|
||||
|
|
@ -27,37 +27,40 @@ async fn initialize_webdriver() {
|
|||
print!("Open webdriver...");
|
||||
io::stdout().flush();
|
||||
let mut output;
|
||||
|
||||
|
||||
let os_type = std::env::consts::OS;
|
||||
let mut chrome_webdriver_path = std::path::PathBuf::new();
|
||||
chrome_webdriver_path.push(std::env::current_dir().unwrap());
|
||||
chrome_webdriver_path.push("chromedriver");
|
||||
|
||||
|
||||
match os_type {
|
||||
"linux" => {
|
||||
chrome_webdriver_path.push("chromedriver");
|
||||
},
|
||||
}
|
||||
"windows" => {
|
||||
chrome_webdriver_path.push("chromedriver.exe");
|
||||
},
|
||||
}
|
||||
_ => {
|
||||
eprintln!("\ntradingbot supports only Linux and Windows.");
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if !chrome_webdriver_path.exists() {
|
||||
eprintln!("\nCheck if there is chromedriver.exe ({})", chrome_webdriver_path.to_str().unwrap());
|
||||
eprintln!(
|
||||
"\nCheck if there is chromedriver.exe ({})",
|
||||
chrome_webdriver_path.to_str().unwrap()
|
||||
);
|
||||
panic!();
|
||||
}
|
||||
|
||||
|
||||
output = Command::new(chrome_webdriver_path)
|
||||
.stdin(Stdio::null())
|
||||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::null())
|
||||
.spawn();
|
||||
output.expect("\nOpening chromedriver failed!");
|
||||
|
||||
|
||||
println!("Ok");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user