Commit 346c65ee by Joel Barciauskas

Remove trace_execution_scoped blocks

parent 1258b84c
......@@ -20,7 +20,6 @@ def get_thread_ids(context, group_ids, local_params, search_text)
)
end
self.class.trace_execution_scoped(['Custom/get_search_threads/es_search']) do
body = {
size: CommentService.config['max_deep_search_comment_count'].to_i,
sort: [
......@@ -55,7 +54,6 @@ def get_thread_ids(context, group_ids, local_params, search_text)
end
end
thread_ids
end
end
def get_suggested_text(search_text)
......
......@@ -54,13 +54,11 @@ get "#{APIPREFIX}/users/:user_id/active_threads" do |user_id|
collection = presenter.to_hash
json_output = nil
self.class.trace_execution_scoped(['Custom/get_user_active_threads/json_serialize']) do
json_output = {
collection: collection,
num_pages: num_pages,
page: page,
}.to_json
end
json_output
end
......
......@@ -150,7 +150,6 @@ helpers do
end
if filter_flagged
self.class.trace_execution_scoped(['Custom/handle_threads_query/find_flagged']) do
# TODO replace with aggregate query?
comment_ids = Comment.where(:course_id => course_id).
where(:abuse_flaggers.ne => [], :abuse_flaggers.exists => true).
......@@ -161,17 +160,14 @@ helpers do
comment_threads = comment_threads.in({"_id" => (comment_ids + thread_ids).uniq})
end
end
if filter_unanswered
self.class.trace_execution_scoped(['Custom/handle_threads_query/find_unanswered']) do
endorsed_thread_ids = Comment.where(:course_id => course_id).
where(:parent_id.exists => false, :endorsed => true).
collect{|c| c.comment_thread_id}.uniq
comment_threads = comment_threads.where({"thread_type" => :question}).nin({"_id" => endorsed_thread_ids})
end
end
sort_criteria = get_sort_criteria(sort_key)
if not sort_criteria
......
......@@ -50,7 +50,6 @@ class User
end
if params[:course_id]
self.class.trace_execution_scoped(['Custom/User.to_hash/count_comments_and_threads']) do
if not params[:group_ids].empty?
# Get threads in either the specified group(s) or posted to all groups (nil).
specified_groups_or_global = params[:group_ids] << nil
......@@ -105,7 +104,6 @@ class User
end
hash = hash.merge!("threads_count" => threads_count, "comments_count" => comments_count)
end
end
hash
end
......
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