Commit bf8d4d5b by Ibrahim Awwal

Add user_id to query_params for the purposes of calculating a hash to avoid cache collisions.

parent 31368258
...@@ -74,7 +74,7 @@ helpers do ...@@ -74,7 +74,7 @@ helpers do
def handle_threads_query(comment_threads) def handle_threads_query(comment_threads)
if CommentService.config[:cache_enabled] if CommentService.config[:cache_enabled]
query_params = params.slice(*%w[course_id commentable_id sort_key sort_order page per_page]) query_params = params.slice(*%w[course_id commentable_id sort_key sort_order page per_page user_id])
memcached_key = "threads_query_#{query_params.hash}" memcached_key = "threads_query_#{query_params.hash}"
cached_results = Sinatra::Application.cache.get(memcached_key) cached_results = Sinatra::Application.cache.get(memcached_key)
if cached_results if cached_results
......
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