migration-tools/0017-add-process-data-in-database.patch

43 lines
1.2 KiB
Diff
Raw Normal View History

2024-11-04 15:59:13 +08:00
From a3b140660e4180fdeddc7d2bb8009a78218a9235 Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Fri, 10 Nov 2023 10:21:12 +0800
Subject: [PATCH] =?UTF-8?q?agent=E5=A2=9E=E5=8A=A0=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sysmig_agent/share.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/sysmig_agent/share.py b/sysmig_agent/share.py
index ea3d63a..aae815c 100644
--- a/sysmig_agent/share.py
+++ b/sysmig_agent/share.py
@@ -9,7 +9,7 @@ import shutil
import subprocess
import socket
from sysmig_agent.utils import list_to_json
-
+from connect_sql import DBHelper
def get_local_ip():
try:
@@ -20,6 +20,12 @@ def get_local_ip():
finally:
s.close()
+def sql_abi_progress(data):
+ sql = "UPDATE agent_task SET task_progress = {} ,task_Updatetime = NOW() WHERE agent_ip = '{}';".format(data, get_local_ip())
+ try:
+ ret = DBHelper().execute(sql)
+ except:
+ pass
def getSysMigConf():
confpath = '/etc/migration-tools/migration-tools.conf'
--
2.20.1