customerio / customerio-ruby

A ruby client for the Customer.io event API.
https://customer.io/docs/api/
MIT License
64 stars 75 forks source link

execution expired - Net::OpenTimeout #105

Open odedharth opened 1 year ago

odedharth commented 1 year ago

Sometimes I get a timeout error for API calls such as $customerio.identify: Backtrace:

Message: execution expired
/app/vendor/ruby-2.6.6/lib/ruby/2.6.0/net/http.rb:947 initialize
/app/vendor/ruby-2.6.6/lib/ruby/2.6.0/net/http.rb:947 open
/app/vendor/ruby-2.6.6/lib/ruby/2.6.0/net/http.rb:947 block in connect
/app/vendor/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:103 timeout
/app/vendor/ruby-2.6.6/lib/ruby/2.6.0/net/http.rb:945 connect
/app/vendor/ruby-2.6.6/lib/ruby/2.6.0/net/http.rb:930 do_start
/app/vendor/ruby-2.6.6/lib/ruby/2.6.0/net/http.rb:919 start
/app/vendor/bundle/ruby/2.6.0/gems/customerio-2.2.1/lib/customerio/client.rb:199 request
/app/vendor/bundle/ruby/2.6.0/gems/customerio-2.2.1/lib/customerio/client.rb:138 create_or_update
/app/vendor/bundle/ruby/2.6.0/gems/customerio-2.2.1/lib/customerio/client.rb:30 identify
  1. Having the function return an error for timeout means that we should wrap up every API call in a begin statement. Is this the intended behavior? I would prefer it not to throw an error in this case.
  2. Can we control the timeout threshold? I would not like it to be more than 3 seconds.