mirror of
https://github.com/Magnus167/msyrs.git
synced 2025-11-19 23:56:11 +00:00
refactor: adjust batch size for ticker downloads and simplify main function logic
This commit is contained in:
@@ -202,7 +202,6 @@ impl JPMaQSDownload {
|
||||
pub fn save_indicators_as_csv(
|
||||
&mut self,
|
||||
download_args: JPMaQSDownloadGetIndicatorArgs,
|
||||
batch_size: usize,
|
||||
folder_path: &str,
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
// if the folder path does not exist, create it
|
||||
@@ -211,7 +210,7 @@ impl JPMaQSDownload {
|
||||
std::fs::create_dir_all(save_path.clone())?;
|
||||
|
||||
// get ticker count, and split into chunks of batch_size
|
||||
let ticker_batches = download_args.tickers.chunks(batch_size);
|
||||
let ticker_batches = download_args.tickers.chunks(500);
|
||||
let batch_download_args = ticker_batches
|
||||
.map(|ticker_batch| {
|
||||
let mut new_args = download_args.clone();
|
||||
|
||||
Reference in New Issue
Block a user