Пример #1
0
def third_step():
    for i in range(7):
        sleep(2)
    print "in third"
    # r_except()
    print "request id ", do_work.request.id

    MonitorThread.update_jobs_state(do_work.request.id, do_work, 'THIRD_STEP', 80, 100)
Пример #2
0
def do_work():
    """ Get some rest, asynchronously, and update the state all the time """
    for i in range(12):
        sleep(1)
    MonitorThread.update_jobs_state(do_work.request.id, do_work, 'DO_WORK', 25, 100)
    print 'calling second'
    second_step()
    print 'calling third'
    third_step()
    forth_step()
Пример #3
0
def forth_step():
    for i in range(2):
        sleep(2)
    print "in forth"
    print "request id ", do_work.request.id
    MonitorThread.update_jobs_state(do_work.request.id, do_work, 'FORTH_STEP', 100, 100)
Пример #4
0
def second_step():
    for i in range(6):
        sleep(2)
    print "in second"
    print "request id ", do_work.request.id
    MonitorThread.update_jobs_state(do_work.request.id, do_work, 'SEC_STEP', 40, 100)