如何在Heroku上更改默认请求超时? [英] How to change default request time out on Heroku?

查看:128
本文介绍了如何在Heroku上更改默认请求超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序基于Rails,生产服务器位于Heroku.

My app is built on Rails and my production server is on Heroku.

我的应用程序主要用于文件上传和文件处理,处理请求需要50秒钟以上.根据Heroku的配置,我的请求没有及时响应,由于请求超时,它会将我发送到应用程序错误页面.

My application is mostly used for file upload and file processing and it takes more than 50 seconds for the request to process. As per the Heroku configuration my request does not respond in time and it sends me to the application error page due to request timeout.

如何在Heroku上更改请求超时配置?

How can I change the request timeout configuration on Heroku?

请帮助我,使应用程序正常工作.

Please help me out to make application working.

推荐答案

根据 Heroku的文档

超时值不可配置.如果您的服务器需要更长的时间 在30秒内完成给定请求,我们建议您将其移动 工作于后台任务或工作人员以定期ping服务器 查看处理请求是否已完成.这种模式释放 您的网络流程可以做更多的工作,并且总体上会减少 应用程序响应时间.

The timeout value is not configurable. If your server requires longer than 30 seconds to complete a given request, we recommend moving that work to a background task or worker to periodically ping your server to see if the processing request has been finished. This pattern frees your web processes up to do more work, and decreases overall application response times.

这篇关于如何在Heroku上更改默认请求超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆