Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I provide a file for downloading while ignoring timeouts

yoexle asked in General

I want to provide a file for downloading. The download is allways cancled after 60 seconds.

I'm hosting my Rails project (ruby '2.7.4', rails '6.1.0') on platform.sh (docs.platform .sh/). Because of this I don't have much control over the underlying Nginx server.
When the download is cancled I receive the error ERROR -- : worker=0 PID:495 timeout (61s > 60s), killing

I tried to provide the file for downloading:

  • via Rubys 'send_file' method
  • via streaming the file in chunks of 1024 bytes 'response.stream.write(chunk)'
  • by placing the file in an /public folder and accessing the url of the file.

The result is always the same. The download is cancles after 60 seconds.

Has someone ever had a comparable error?
Is there something I can change in my Rails project or has it to do with the Nginx server

Best Regards

Reply

Downloading / emailing a file should be more so a background job so you don't block other processes (app) specially if its a large file.

Reply

oh right? Thanks for sharing!
cookie clicker free games

Reply

Excellent article plus its information and I positively bookmark to this site because here I always get an amazing knowledge as I expect. Thanks for this to share with us.

Reply

ok!

Reply

The information on the sharing site is really important and necessary for everyone

Reply

Thanks for sharing!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.