From def2140a1af0592e1472b622bcfa5e57f1daeed1 Mon Sep 17 00:00:00 2001 From: ljl <17743125563@163.com> Date: Wed, 4 Dec 2024 19:10:37 +0800 Subject: [PATCH] spi-stats:fix event. --- backend/spi/spi-stats/src/event.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/spi/spi-stats/src/event.rs b/backend/spi/spi-stats/src/event.rs index 3d8cbb8ac..fb5a55c32 100644 --- a/backend/spi/spi-stats/src/event.rs +++ b/backend/spi/spi-stats/src/event.rs @@ -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}, @@ -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(()) }