Hi,
I am having trouble getting the run_result after web2py has finished a
task using web2py's scheduler.
The code below is what I am using. The trouble I am having is grabbing the
result once the result is
ready. Do any of you know how to get the run_result from a task once the
task has finished? right now
when I try to get the run_result I get a "None" value because I try to get
the result before it is ready.
The task can take a couple of seconds to finish. I have tried many
different ways to get the result once
it is ready. For instance, creating a while loop that checks to see if the
task status has changed to
"completed" then grab the result, but that does not work. Any ideas? I have
been stuck on this far too long.
task2 = sched.queue_task('upsQuote', pargs = [session.Weight,
session.OrigZip, session.DestZip], timeout = 5, start_time = request.now)
#add the task
task_status2 = sched.task_status(task2.uuid, output=True) # get
the task status
result2 = task_status2.scheduler_run.run_result
# get the result from the finished task
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.