All threads / How do I provide a file for downloading while ignoring timeouts

Ask A Question


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 (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 ''
  • 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

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.

oh right? Thanks for sharing!
cookie clicker free games

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.