Method: Couchbase::Protostellar::Timeouts#timeout_for_request

Defined in:
lib/couchbase/protostellar/timeouts.rb

#timeout_for_request(request) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/couchbase/protostellar/timeouts.rb', line 48

def timeout_for_request(request)
  case request.service
  when :analytics
    @analytics_timeout
  when :kv
    if request.proto_request.respond_to?(:durability_level) && request.proto_request.has_durability_level?
      @key_value_durable_timeout
    else
      @key_value_timeout
    end
  when :query
    @query_timeout
  when :search
    @search_timeout
  when :view
    @view_timeout
  when :bucket_admin, :collection_admin, :query_admin, :search_admin
    @management_timeout
  else
    raise Couchbase::Error::CouchbaseError, "Service #{service} not recognised"
  end
end