Skip to content

Commit

Permalink
spi-stats:fix event.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Dec 4, 2024
1 parent c853e5e commit def2140
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions backend/spi/spi-stats/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{get_tardis_inst, serv::stats_record_serv};
use crate::{dto::stats_record_dto::StatsFactRecordLoadReq, get_tardis_inst, serv::stats_record_serv};
use bios_sdk_invoke::clients::{
event_client::{get_topic, mq_error, ContextHandler, SPI_RPC_TOPIC},
spi_log_client::{StatsItemAddReq, StatsItemDeleteReq},
Expand All @@ -12,7 +12,15 @@ use tardis::{
async fn handle_add_event(req: StatsItemAddReq, ctx: TardisContext) -> TardisResult<()> {
let funs = get_tardis_inst();
if let Some(ref key) = req.key {
stats_record_serv::fact_record_load(&req.tag, key.as_ref(), req.clone().into(), &funs, &ctx).await?;
let record_load_req = StatsFactRecordLoadReq {
own_paths: req.own_paths.unwrap_or_default(),
ct: req.ts.unwrap_or_default(),
idempotent_id: req.idempotent_id,
ignore_updates: Some(true),
data: req.content,
ext: req.ext,
};
stats_record_serv::fact_record_load(&req.tag, key.as_ref(), record_load_req, &funs, &ctx).await?;
}
Ok(())
}
Expand Down

0 comments on commit def2140

Please sign in to comment.