From 32ca229efde1bf92035be109f01a8f7ae48e3370 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Mon, 9 Oct 2023 15:17:26 +0800 Subject: [PATCH] =?UTF-8?q?step1=20=E7=9A=84=20=E7=A7=BB=E5=8A=A8=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E7=9B=AE=E5=BD=95=20=E4=BB=A3=E7=A0=81=E6=9B=B4?= =?UTF-8?q?=E5=88=B0=E6=9C=80=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_step1.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main_step1.py b/main_step1.py index c105048..2cd3918 100644 --- a/main_step1.py +++ b/main_step1.py @@ -157,16 +157,18 @@ def step1(pid, experience=False, makeloop=True): print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} step1图片预处理完成,共费时{libs.diff_time(start_time)}') + if os.path.exists(os.path.join(config.sharedir, pid)): + shutil.rmtree(os.path.join(config.sharedir, pid), ignore_errors=True) + shutil.copytree(os.path.join(config.workdir, pid), os.path.join(config.sharedir, pid)) + print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} step1任务完成,移动到共享目录') + # TODO: 更新本地step1任务状态,加入step2任务队列 if makeloop: os.system(f'python main_step2.py {pid}') else: os.system(f'python main_step2.py {pid}') - # if os.path.exists(os.path.join(config.sharedir, pid)): - # shutil.rmtree(os.path.join(config.sharedir, pid), ignore_errors=True) - # shutil.move(os.path.join(config.workdir, pid), config.sharedir) - - # print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {pid} step1任务完成,移动到共享目录') + + def main(pid, experience=False, makeloop=True): if pid == '0':