Browse Source

step1 的 移动共享目录 代码更到最新

master
dongchangxi 2 years ago
parent
commit
32ca229efd
  1. 12
      main_step1.py

12
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)}') 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任务队列 # TODO: 更新本地step1任务状态,加入step2任务队列
if makeloop: if makeloop:
os.system(f'python main_step2.py {pid}') os.system(f'python main_step2.py {pid}')
else: else:
os.system(f'python main_step2.py {pid}') 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): def main(pid, experience=False, makeloop=True):
if pid == '0': if pid == '0':

Loading…
Cancel
Save