MrW*_*ter 5 timeout ruby-on-rails heroku
我正在运行一个 rails 应用程序,它有一个来自用 C++ 开发的本地客户端的 json webservice 调用(一个带有多部分 json 表单的 post 命令,上传一个流文件)
我已经在 Heroku 文档上阅读了关于路由网格的内容,提到了 http 连接的 30 秒 Heroku 限制,以及关于长轮询替代方案,指的是工作人员 dynos。
在通话期间,我处理 pdf 文档并在其中插入签名。这个 pdf 文件可以是 100kb 或 11Mb(或者更多)。
我知道我最终必须在后台进程上执行此操作,但我想在绝对必要之前避免这样做。
你知道有什么方法可以增加这个超时吗?
正如您在下面的代码中看到的那样,我正在保存文档后对其进行处理(我在after_save.
我非常希望客户端在文档处理之前得到响应,但我仍然在 heroku 端超时,在我的客户端出现错误。
对于较小的文档,这一切都很好,但是对于只有 400kb 的 121 页 pdf 文档,它会爆炸..
最后,我的文件被上传了,所以我需要的是在超时响应被发送之前让该响应继续到我的客户端应用程序......
有什么建议?
我的错误:
at=error code=H12 desc="Request timeout" method=POST path=/documents host=fierce-beach-2720.herokuapp.com fwd="81.193.155.217/bl4-155-217.dsl.telepac.pt" dyno=web.1 queue=0ms wait=0ms connect=1ms service=32272ms status=503 bytes=0
Run Code Online (Sandbox Code Playgroud)
我的控制器:
respond_to do |format|
if @document.save!
format.html { redirect_to root_path, :flash => { :success => 'Document was successfully created.'} }
format.json { render json: @document, status: :created, location: @document}
@document.document_process
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10329 次 |
| 最近记录: |