I have a pretty long process (40 seconds) script.
It is kicked off from one controller action from web browser.
The problem is, the Rails does not wait until the process is done. It actually stops the process at about 5 seconds, and goes to the next step.
def _run_script (my_id)
system ("my_long_runni ng_script.sh")
redirect_to :action =>'edit', :id => my_id
end
I tried Process , wait. It still doesn't work.
If I run the action from the controller unit test, it can wait for finishing though.
Any way to solve it ?
Thanks
~Andrew Che
It is kicked off from one controller action from web browser.
The problem is, the Rails does not wait until the process is done. It actually stops the process at about 5 seconds, and goes to the next step.
def _run_script (my_id)
system ("my_long_runni ng_script.sh")
redirect_to :action =>'edit', :id => my_id
end
I tried Process , wait. It still doesn't work.
If I run the action from the controller unit test, it can wait for finishing though.
Any way to solve it ?
Thanks
~Andrew Che
Comment