3 ms·
Not to be a naysayer but it might be a better effort to prevent having to do a bunch of work before returning a response. Have you considered polling for all th
by hderms 8y ago
Not to be a naysayer but it might be a better effort to prevent having to do a bunch of work before returning a response. Have you considered polling for all the jobs to be completed instead?
- nate 8y agoHello. No apologies necessary! Wanted to put this out there for the discussion. So thanks for the comment. I'm not sure what you mean though. This is polling to see if the jobs are completed. Every two seconds it goes and polls the status of each of the Jobs that were kicked off. Timeout::timeout(15 * 60) do while(!all_job_statuses_complete?(all_jobs)) do sleep 2 end end Was there something else you were referring to?
- wstuartcl 8y agoTimeout::timeout has many very sharp edges you should be aware of before you use in this context.
- nate 8y agoVery true. Could just as easily just count the number of times we've looped through this and multiply by our sleep to get a sense of time taken place. Thanks for the poke at that!