How do I provide a file for downloading while ignoring timeouts
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
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.
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.