设置时间限制,等待任务结束
import time
print('start task and wait')
waitflag = 0
timeline = 10
while True:
time.sleep(60)
print('check process and get result')
task_reslut = True
if task_reslut:
waitflag += 1
else:
waitflag = 0
if waitflag >= timeline:
print('task end success')
break