From a3dbe2f39d40108f9abefecfbc2e432408458506 Mon Sep 17 00:00:00 2001
From: ljl <17743125563@163.com>
Date: Thu, 12 Dec 2024 16:09:11 +0800
Subject: [PATCH] spi-stats:fix sync task.

---
 backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs    | 1 +
 backend/spi/spi-stats/src/serv/pg/stats_pg_conf_fact_serv.rs | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs b/backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs
index 61e42363..cac3bc97 100644
--- a/backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs
+++ b/backend/spi/spi-search/src/serv/pg/search_pg_item_serv.rs
@@ -941,6 +941,7 @@ fn package_ext(
     }
     Ok(())
 }
+
 fn merge(a: &mut serde_json::Value, b: serde_json::Value) {
     match (a, b) {
         (a @ &mut serde_json::Value::Object(_), serde_json::Value::Object(b)) => {
diff --git a/backend/spi/spi-stats/src/serv/pg/stats_pg_conf_fact_serv.rs b/backend/spi/spi-stats/src/serv/pg/stats_pg_conf_fact_serv.rs
index bdf5f403..8923b0c8 100644
--- a/backend/spi/spi-stats/src/serv/pg/stats_pg_conf_fact_serv.rs
+++ b/backend/spi/spi-stats/src/serv/pg/stats_pg_conf_fact_serv.rs
@@ -77,7 +77,7 @@ VALUES
         AddOrModifySyncTaskReq {
             code: format!("{}_{}", SYNC_FACT_TASK_CODE, add_req.key),
             cron: add_req.sync_cron.clone().unwrap_or("".to_string()),
-            callback_url: format!("{}/ci/{}/sync", funs.conf::<StatsConfig>().base_url, add_req.key),
+            callback_url: format!("{}/ci/fact/{}/sync", funs.conf::<StatsConfig>().base_url, add_req.key),
             callback_method: "PUT".to_string(),
             callback_body: None,
             enable: add_req.is_sync.unwrap_or_default(),
@@ -165,7 +165,7 @@ WHERE key = $1
             code: format!("{}_{}", SYNC_FACT_TASK_CODE, fact_conf_key),
             enable: modify_req.is_sync.unwrap_or_default(),
             cron: modify_req.sync_cron.clone().unwrap_or("".to_string()),
-            callback_url: format!("{}/ci/{}/sync", funs.conf::<StatsConfig>().base_url, fact_conf_key),
+            callback_url: format!("{}/ci/fact/{}/sync", funs.conf::<StatsConfig>().base_url, fact_conf_key),
             callback_method: "PUT".to_string(),
             callback_body: None,
             callback_headers,