Commit 0f44adf2 by Rocky Duan

output message when cache hit

parent 818fa573
...@@ -93,7 +93,10 @@ class CommentThread < Content ...@@ -93,7 +93,10 @@ class CommentThread < Content
if CommentService.config[:cache_enabled] if CommentService.config[:cache_enabled]
memcached_key = "threads_search_#{params.merge(options).hash}" memcached_key = "threads_search_#{params.merge(options).hash}"
results = Sinatra::Application.cache.get(memcached_key) results = Sinatra::Application.cache.get(memcached_key)
return results if results if results
puts "cache hit"
return results
end
puts "cache miss" puts "cache miss"
end end
search = Tire::Search::Search.new 'comment_threads' search = Tire::Search::Search.new 'comment_threads'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment