slack-ruby-client icon indicating copy to clipboard operation
slack-ruby-client copied to clipboard

Reasonable Timeout Limit

Open zinosama opened this issue 5 years ago • 1 comments

Hello Slack Team,

I'm not sure if this is the right forum for this question, but for users of this gem, is there a recommended setting for timeout?

I have an internal app that sends messages to my workspace via chat_postMessage when certain internal events happen (sending a dozen of messages per minute). My current open and read timeouts are both set at 3 seconds. Everyday, I see a handful of Faraday::ConnectionFailed being thrown, which then resolves themselves upon retry. Is 3 second a reasonable timeout? Please feel free to point me to any official doc or share some recommendations/best practices around this.

Thank you very much for your time and attention!

zinosama avatar May 08 '20 19:05 zinosama

Hello Slack Team,

I don't believe anyone here works for slack.

Are you reusing a connection? Try HEAD with #322 and this:

require 'net/http/persistent'

Faraday.default_adapter = Faraday::Adapter::NetHttpPersistent

It should reduce the number of times your client need to connect and therefore will have fewer or no timeouts.

dblock avatar May 08 '20 20:05 dblock