Permalink
Browse files

optimizations

  • Loading branch information...
mislav committed Feb 6, 2012
1 parent a4409e6 commit 29adf1e2bc5eb7ccdb56585aabf8552bad3057c0
Showing with 5 additions and 3 deletions.
  1. +3 −1 app.rb
  2. +0 −2 config.ru
  3. +2 −0 instagram.rb
View
4 app.rb
@@ -57,7 +57,7 @@
warn "MongoDB connection failed: #{$!}"
end
- ActiveSupport::Cache::Store.instrument = true
+ ActiveSupport::Cache::Store.instrument = settings.development?
ActiveSupport::Notifications.subscribe('search.indextank') do |name, start, ending, _, payload|
$stderr.puts 'IndexTank search for "%s" (%.3f s)' % [payload[:query], ending - start]
@@ -82,6 +82,8 @@
$stderr.puts "Cache rebuild: %s (%.3f s)" % [payload[:key], ending - start]
when 'cache_read'
$stderr.puts "Cache hit: %s" % payload[:key] if payload[:hit]
+ when 'cache_fetch_hit'
+ $stderr.puts "Cache hit: %s" % payload[:key]
end
end
end
View
@@ -7,7 +7,5 @@ $LOAD_PATH.unshift ENV['APP_ROOT'] || File.expand_path('..', __FILE__)
Encoding.default_external = 'utf-8'
-require 'ruby-debug' if ENV['RACK_ENV'] == 'development'
-
require 'app'
run Sinatra::Application
View
@@ -66,6 +66,8 @@ def connection
end
conn.headers['User-Agent'] = 'instagram.heroku.com ruby client'
+ conn.options[:timeout] = 6
+ conn.options[:open_timeout] = 2
conn
end
end

0 comments on commit 29adf1e

Please sign in to comment.