simple sleep for now. will fix with better waits later

This commit is contained in:
Bryan Stitt 2023-06-27 10:50:15 -07:00
parent 86f9560fc3
commit 25e5caaab8
2 changed files with 5 additions and 1 deletions

@ -57,6 +57,7 @@ impl SearchKafkaSubCommand {
.kafka_urls
.context("top_config.app.kafka_urls is required")?;
// TODO: sea-streamer instead of rdkafka?
let mut consumer = ClientConfig::new();
let security_protocol = &top_config.app.kafka_protocol;

@ -10,7 +10,7 @@ use migration::sea_orm::prelude::Decimal;
use migration::sea_orm::DatabaseConnection;
use std::time::Duration;
use tokio::sync::broadcast;
use tokio::time::interval;
use tokio::time::{interval, sleep};
use tracing::{error, info, trace};
#[derive(Debug, Default)]
@ -162,6 +162,9 @@ impl StatBuffer {
}
}
// TODO: don't just sleep. wait for things to actually finish
sleep(Duration::from_secs(10)).await;
let saved_relational = self.save_relational_stats().await;
info!("saved {} pending relational stat(s)", saved_relational);