don't wait before fetching first set of data
This commit is contained in:
parent
235104ae75
commit
38cd013ab9
1 changed files with 4 additions and 0 deletions
|
@ -178,6 +178,10 @@ async fn main() -> std::io::Result<()> {
|
|||
|
||||
// a simple way to output a CSV header
|
||||
println!("period start,symbol,price,change %,min,max,30d avg");
|
||||
|
||||
// initial data fetch
|
||||
fetch_and_output_symbol_data(&opts.symbols, from, to).await?;
|
||||
|
||||
let mut interval = async_std::stream::interval(Duration::from_secs(30));
|
||||
while let Some(_) = interval.next().await {
|
||||
fetch_and_output_symbol_data(&opts.symbols, from, to).await?;
|
||||
|
|
Loading…
Reference in a new issue