From 127580df37b9b0264af9b54e4618a9b0e1939dda Mon Sep 17 00:00:00 2001
From: xuezhixin <xuezhixin@uniontech.com>
Date: Mon, 13 Nov 2023 16:11:45 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=BF=81=E7=A7=BB?=
 =?UTF-8?q?=E7=8A=B6=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 sysmig_agent/fork.py | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/sysmig_agent/fork.py b/sysmig_agent/fork.py
index 3447678..3f81aea 100644
--- a/sysmig_agent/fork.py
+++ b/sysmig_agent/fork.py
@@ -198,3 +198,31 @@ def abi_file_sql(path):
                 info_str = info_str+','
         abi_file_connect(info_str)
 
+
+def check_environment(data):
+    task_id = json.loads(data).get('task_id')
+    # 更新SQL任务状态
+    sql_task_statue('1', task_id)
+    # 发送消息给Server更新任务流状态
+    post_server('task_start', task_id)
+    process_time_task_abi(task_id)
+    # tar.gz types abi report
+    targz_mig_dir_abi()
+    sql_task_statue('2', task_id)
+    post_server('task_close', task_id)
+
+
+# 初始化进度阶段
+def mig_modify_statue(task_id):
+    if not get_mig_state(task_id):
+        sql_mig_statue('00')
+        '''
+    else:
+        # Too many migration requests
+        # If you need to continue the migration, please change the task_data of the Mysql
+        return 1
+        ret = get_mig_state(task_id)
+        ret = re.sub('[0-9]', '0', ret[0]) + ret[1]
+        sql_mig_statue(ret)
+    # loggea
+    '''
\ No newline at end of file
-- 
2.20.1

