Supply a custom Faraday connection
还没有人认领这个 Issue。
评估
调研方向
Read lib/slack/web/faraday/connection.rb around lines 16-25, then trace the files_upload path in lib/slack/web/api/endpoints/files.rb. Determine how callers can customize the Faraday connection's read timeout, and verify that files.upload can use the configured value without changing the default behavior.
由索引模型根据 Issue 内容生成。
描述
I'm using the files.upload API, and started getting this error on a few files:
Faraday::TimeoutError Net::ReadTimeout
vendor/gems/ruby/2.1.0/gems/slack-ruby-client-0.2.1/lib/slack/web/faraday/request.rb:25:in `request'
vendor/gems/ruby/2.1.0/gems/slack-ruby-client-0.2.1/lib/slack/web/faraday/request.rb:10:in `post'
vendor/gems/ruby/2.1.0/gems/slack-ruby-client-0.2.1/lib/slack/web/api/endpoints/files.rb:70:in `files_upload'
The Net::ReadTimeout is coming from using Faraday's default adapter, ie net/http. That happens when the read_timeout is exceeded, which defaults to 60 seconds http://ruby-doc.org/stdlib-2.1.1/libdoc/net/http/rdoc/Net/HTTP.html#read_timeout
It's probably not great to go past this in general, but it might be expected for large files. It should be possible to customize the read_timeout when the Faraday::Connection is constructed, but I'm not seeing any way to customize this: https://github.com/dblock/slack-ruby-client/blob/e4c39604b6d00da1e419d63db68e30032f5a08e1/lib/slack/web/faraday/connection.rb#L16-L25
I realize I'm on an older version, so I will try upgrading but I don't think that will change anything. I'm still debugging the file in question to determine how big it is, but I figured I'd drop this in case anyone runs into similar.
- 主要语言
- Ruby
- 星标
- 1.3k
- 派生
- 222
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
slack-ruby/slack-ruby-client 的其他 Issue
-
new feature question
难度 2/5 1-3 小时 新手友好度 65/100
slack-ruby/slack-ruby-client#586 · 3 条评论 ·
-
bug?
难度 2/5 1-3 小时 新手友好度 45/100
slack-ruby/slack-ruby-client#579 · 3 条评论 ·
-
new feature web api
难度 3/5 1-2 天 新手友好度 42/100
slack-ruby/slack-ruby-client#482 · 5 条评论 ·
-
new feature
难度 4/5 3-5 天 新手友好度 35/100
slack-ruby/slack-ruby-client#414 · 14 条评论 ·
-
confirmed bug
难度 3/5 1-2 天 新手友好度 35/100
slack-ruby/slack-ruby-client#409 · 5 条评论 ·
查看 slack-ruby/slack-ruby-client 的全部 Issue
相似的 Issue
-
user-reported
难度 2/5 1-3 小时 新手友好度 85/100
Kong/developer.konghq.com#7316 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
TheOdinProject/curriculum#31408 ·
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
notch8/utk_knapsack#148 ·
-
难度 1/5 1 小时以内 新手友好度 78/100
Homebrew/homebrew-cask#288729 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100