From ac11720747349d0ef7e0370b8bdf110c32a6f6db Mon Sep 17 00:00:00 2001 From: "mingsheng.li" Date: Fri, 25 Jul 2025 17:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B3=E4=BA=8Edocker?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E9=89=B4=E6=9D=83=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy-dbf-import.sh | 10 +++++----- src/pipelines/dbf_to_postgres.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/deploy-dbf-import.sh b/scripts/deploy-dbf-import.sh index 59da2f0..93b2931 100644 --- a/scripts/deploy-dbf-import.sh +++ b/scripts/deploy-dbf-import.sh @@ -9,11 +9,11 @@ BATCH_SIZE=${BATCH_SIZE:-"1000"} LOG_LEVEL=${LOG_LEVEL:-"INFO"} DATA_PVC_NAME=${DATA_PVC_NAME:-"data-import-export-pvc"} # todo: 下面参数使用时需要修改 -DB_HOST=${DB_HOST:-"xx-postgres-service"} -DB_PORT=${DB_PORT:-"5432"} -DB_NAME=${DB_NAME:-"xx"} -DB_USER=${DB_USER:-"xx_db_user"} -DB_PASSWORD=${DB_PASSWORD:-"xx_db_password"} +DB_HOST=${DB_HOST:-"test-db.db.svc.cluster.local"} +DB_PORT=${DB_PORT:-"6432"} +DB_NAME=${DB_NAME:-"idrc"} +DB_USER=${DB_USER:-"idrc"} +DB_PASSWORD=${DB_PASSWORD:-"a8aa283c1b3ca0bdfe1d2669dd400f3d"} # 导出变量用于envsubst diff --git a/src/pipelines/dbf_to_postgres.py b/src/pipelines/dbf_to_postgres.py index 0c00152..8a2febf 100644 --- a/src/pipelines/dbf_to_postgres.py +++ b/src/pipelines/dbf_to_postgres.py @@ -154,7 +154,7 @@ class DbfToPostgresPipeline(BasePipeline): if len(batch_data) >= batch_size: # todo:本地调试先注释掉 self.db.execute_batch( - "INSERT INTO target_table (t, device_instance_capability_id, point_id, value) VALUES (%s, %s, %s, %s)", + "INSERT INTO current_states (t, device_instance_capability_id, point_id, value) VALUES (%s, %s, %s, %s)", batch_data ) # todo:本地调试先注释掉 @@ -170,7 +170,7 @@ class DbfToPostgresPipeline(BasePipeline): if batch_data: # todo:本地调试先注释掉 self.db.execute_batch( - "INSERT INTO target_table (t, device_instance_capability_id, point_id, value) VALUES (%s, %s, %s, %s)", + "INSERT INTO current_states (t, device_instance_capability_id, point_id, value) VALUES (%s, %s, %s, %s)", batch_data ) # todo:本地调试先注释掉