lib/supergood/client.rb in supergood-0.1.4 vs lib/supergood/client.rb in supergood-0.1.5

- old
+ new

@@ -9,11 +9,11 @@ Dotenv.load module Supergood - DEFAULT_SUPERGOOD_BASE_URL = 'https://dashboard.supergood.ai' + DEFAULT_SUPERGOOD_BASE_URL = 'https://api.supergood.ai' class << self def init(config={}) supergood_client_id = config[:client_id] || ENV['SUPERGOOD_CLIENT_ID'] supergood_client_secret = config[:client_secret] || ENV['SUPERGOOD_CLIENT_SECRET'] @@ -118,14 +118,16 @@ def intercept(request) request_id = SecureRandom.uuid requested_at = Time.now if !ignored?(request[:domain]) + puts "Caching Request" cache_request(request_id, requested_at, request) end response = yield if !ignored?(request[:domain]) && defined?(response) + puts "Caching Response" cache_response(request_id, requested_at, response) end return response[:original_response] end