Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout value assignment is static right now #11

Open
sonam-clarion opened this issue Apr 28, 2016 · 0 comments
Open

Timeout value assignment is static right now #11

sonam-clarion opened this issue Apr 28, 2016 · 0 comments

Comments

@sonam-clarion
Copy link

For one of my project I was facing an error during cap deployment.

  • 2016-04-28 01:27:44 executing deploy:start_notify_slack' /home/user/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/net/http.rb:878:ininitialize': execution expired (Faraday::TimeoutError)

My code block in deploy.rb

  task :start_notify_slack, :roles => :app do
    ::SlackNotify::Client.new(slack_subdomain, slack_token, {
      channel: slack_channel,
      username: slack_username,
      icon_emoji: slack_emoji
    }).notify("#{slack_local_user} started deploying #{slack_application}'s #{branch} to #{fetch(:stage, 'production')}")
  end

I realized after reviewing the file slack-notify/lib/slack-notify/connection.rb in the gem that there were static time out value assignment in payload method :

def send_payload(payload)
      conn = Faraday.new(@webhook_url) do |c|
        c.use(Faraday::Request::UrlEncoded)
        c.adapter(Faraday.default_adapter)
   **  c.options.timeout      = 5
        c.options.open_timeout = 5 **
      end

For resolving the issue for now I have made changes to my gem locally. But I think it should not be a static value there should be an optional parameter option for assigning timeout values. I hope it explains the issue. Feel free to reach me in case you want more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant