分布式任务的修改,step2 和 step3 一起跑
This commit is contained in:
1 parent
5f92f7e230
commit
fe9c6e6267
3 files changed
+34
-6
No files matched your search
+3
-2
@@ -209,8 +209,9 @@ def step3(pid,task_distributed_id=""):
|
||||
shutil.rmtree(os.path.join(config.workdir, pid), ignore_errors=True)
|
||||
libs_db.finish_task({"task_type": "make", "task_key": pid})
|
||||
if task_distributed_id:
|
||||
#更新子表的finished_at
|
||||
main_service_db.update_task_distributed_detail({"task_distributed_id":task_distributed_id,"finished_at":time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())})
|
||||
#因为step2 和step3 是一起跑的,所以这一步先注释掉更新子表的finished_at
|
||||
#main_service_db.update_task_distributed_detail({"task_distributed_id":task_distributed_id,"finished_at":time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())})
|
||||
|
||||
#更新主表的status 和 finished_at
|
||||
main_service_db.update_task_distributed({"id":task_distributed_id,"status":2,"finished_at":time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())})
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user