[Rails] Re: Handle Net::FTP connection timeout

2009-03-31 Thread Brian Zzzzzz
Frederick Cheung wrote: > On Mar 31, 3:41�pm, Danimal wrote: > >> The flip-side may make more sense, while I think of it: spawn a thread >> to do the FTP connection and have your main thread sleep 30 seconds. >> Then have the main thread check the status and if need be kill the FTP >> connection

[Rails] Re: Handle Net::FTP connection timeout

2009-03-31 Thread Frederick Cheung
On Mar 31, 3:41 pm, Danimal wrote: > The flip-side may make more sense, while I think of it: spawn a thread > to do the FTP connection and have your main thread sleep 30 seconds. > Then have the main thread check the status and if need be kill the FTP > connection or the child thread altogethe

[Rails] Re: Handle Net::FTP connection timeout

2009-03-31 Thread bill walton
Hi Brian, On Tue, 2009-03-31 at 16:14 +0200, Brian Zz wrote: > I have a method that uploads a selection of files via FTP. For each file > the method gets the file's associated ftp host/domain, user name and > password, connects, uploads the file, updates the status of the file and > saves th

[Rails] Re: Handle Net::FTP connection timeout

2009-03-31 Thread Danimal
Hi Brian! I don't know about Net::FTP, but as a suggestion: what if you spawned a separate thread right before you open the connection and that thread does a: sleep(30) then checks the FTP connection and forces it to close if need be. Of course, if there isn't a way to check the connection separ