Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
bf8d4d5b
Commit
bf8d4d5b
authored
Sep 18, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add user_id to query_params for the purposes of calculating a hash to avoid cache collisions.
parent
31368258
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lib/helpers.rb
+2
-2
No files found.
lib/helpers.rb
View file @
bf8d4d5b
...
...
@@ -74,7 +74,7 @@ helpers do
def
handle_threads_query
(
comment_threads
)
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
}
"
cached_results
=
Sinatra
::
Application
.
cache
.
get
(
memcached_key
)
if
cached_results
...
...
@@ -97,7 +97,7 @@ helpers do
"desc"
=>
:desc
,
"asc"
=>
:asc
,
}
sort_key
=
sort_key_mapper
[
params
[
"sort_key"
]]
sort_order
=
sort_order_mapper
[
params
[
"sort_order"
]]
sort_keyword_valid
=
(
!
params
[
"sort_key"
]
&&
!
params
[
"sort_order"
]
||
sort_key
&&
sort_order
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment