设置时间限制,等待任务结束

设置时间限制,等待任务结束

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
上一篇:Mybatis配置


下一篇:java – “if(rs.next())”是什么意思?