I have a Ruby thread that first connects to an FTP server and then uploads thousands of files. Due to some connectivity issues, the Ruby thread often freezes. Therefore, I want to set a timeout for idle ftp.
A post by Ruby Net :: FTP Timeout Threads suggests using the Timeout module:
begin Timeout.timeout(10) do // connect to FTP and upload end rescue Timeout::Error ... end
This approach will not solve my problem, because the timeout is for the entire block of calculations, not the timeout, starting with the inactivity and inactivity of the FTP session.
So what should I do?
source share