|
|
@@ -252,7 +252,10 @@ fn run(start: Instant, logger: &slog::Logger) -> Result<usize, String> { |
|
|
|
|
|
|
|
if trade.ticker != t!(btc-usd) { continue } |
|
|
|
|
|
|
|
if trade.time >= next_hour { // finalize last hour, and prepare for this hour |
|
|
|
if trade.time >= next_hour { |
|
|
|
// `trade` is past the last hour bucket, so finalize/write last |
|
|
|
// hour results, and reset state for this hour |
|
|
|
|
|
|
|
if n_bmex == 0 || n_gdax == 0 { |
|
|
|
wtr.write_record(&[ |
|
|
|
&format!("{}", cur_hour), |
|
|
@@ -334,7 +337,7 @@ fn run(start: Instant, logger: &slog::Logger) -> Result<usize, String> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// intentionally skipping the partial hour here |
|
|
|
// intentionally skipping handling the partial hour here |
|
|
|
|
|
|
|
info!(logger, "finished parsing CSV/calculating query. closing output file"); |
|
|
|
drop(wtr); |
|
|
|