lib/centaman/service.rb in centaman-3.0.0 vs lib/centaman/service.rb in centaman-3.1.0
- old
+ new
@@ -1,11 +1,11 @@
require 'timeout'
module Centaman
#:nodoc:
class Service < Wrapper
- DEFAULT_TIMEOUT_TIME = 15
+ DEFAULT_TIMEOUT_TIME = 20
def after_init(args)
# overwritten by subclasses
end
@@ -15,10 +15,11 @@
begin
resp = Timeout.timeout(time) do
proc.call
end
rescue Timeout::Error
+ p "*** CENTAMAN GEM TIMEOUT ***"
raise Exceptions::CentamanTimeout
end
resp
end
@@ -27,11 +28,11 @@
req = Proc.new do
self.class.get(endpoint, payload(:get))
end
resp = wrap_request_in_case_of_timeout(req, timeout_time: 20)
- raise resp['Message'] if resp.is_a?(Hash)
- raise Exceptions::CentamanTimeout unless resp.success?
+ raise resp['Message'] if resp && resp.is_a?(Hash)
+ raise Exceptions::CentamanTimeout unless resp && resp.success?
resp
end
end
def post