473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Rails doesn't wait for script to finish

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_running_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
May 10 '07 #1
1 4020
It turned out to be that my script exit halfway because of error.

Rail is OK :-)

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_running_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
May 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: flab ba | last post by:
The pragmatic programmers (Dave & Andy) are spreading a good word about RubyOnRails. I was wondering if there are any Python programmers who are /also/ familiar with Rails - and if they could...
1
by: Bouke Woudstra | last post by:
Hi, I'm a bit stuck with this python script. It's aim is to encode all flac files to wav and then to mp3. The only problem I have is to preserve the tags. The code works when there's just one...
149
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? --...
11
by: Peter Kirk | last post by:
Hi there I am looking at using a thread-pool, for example one written by Jon Skeet (http://www.yoda.arachsys.com/csharp/miscutil/). Can anyone tell me if this pool provides the possibility to...
18
by: Coder | last post by:
Howdy everybody! How do I do the following... while (myVary != true){}; Obviously I do not want to use 100% of the processor to stay in this infinite loop till myVar == true. But wait do I...
92
by: Ray | last post by:
I just moved to another company that's mainly a Java/.NET shop. I was happy to find out that there's a movement from the grassroot to try to convince the boss to use a dynamic language for our...
42
by: kenneth.m.mcdonald | last post by:
First, I don't intend this to be a flame war, please. Python and Ruby are the only two languages I'd willingly work in (at least amongst common languages), and TurboGears and Rails seem roughly...
12
by: Peter Michaux | last post by:
Hi, I am experimenting with some of the Ruby on Rails JavaScript generators and see something I haven't before. Maybe it is worthwhile? In the page below the script is enclosed in //<!]> ...
5
by: Eric Promislow | last post by:
Here's a small Python program I use to grab the output from rake: ===== from subprocess import Popen, PIPE p = Popen(args='c:\\ruby\\bin\\ruby.exe c:\\ruby\\bin\\rake -T',...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.