Commit 64cedf39 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'remove-todo-comment-update-mrs-logging' into 'master'

Remove a TODO for UpdateMergeRequestsWorker logging

See merge request gitlab-org/gitlab!27105
parents 54b2524f 79d1b334
......@@ -18,21 +18,7 @@ class UpdateMergeRequestsWorker # rubocop:disable Scalability/IdempotentWorker
user = User.find_by(id: user_id)
return unless user
# TODO: remove this benchmarking when we have rich logging
time = Benchmark.measure do
MergeRequests::RefreshService.new(project, user).execute(oldrev, newrev, ref)
end
args_log = [
"elapsed=#{time.real}",
"project_id=#{project_id}",
"user_id=#{user_id}",
"oldrev=#{oldrev}",
"newrev=#{newrev}",
"ref=#{ref}"
].join(',')
Rails.logger.info("UpdateMergeRequestsWorker#perform #{args_log}") if time.real > LOG_TIME_THRESHOLD # rubocop:disable Gitlab/RailsLogger
end
# rubocop: enable CodeReuse/ActiveRecord
end
......@@ -26,17 +26,5 @@ describe UpdateMergeRequestsWorker do
perform
end
context 'when slow' do
before do
stub_const("UpdateMergeRequestsWorker::LOG_TIME_THRESHOLD", -1)
end
it 'logs debug info' do
expect(Rails.logger).to receive(:info).with(a_string_matching(/\AUpdateMergeRequestsWorker#perform.*project_id=#{project.id},user_id=#{user.id},oldrev=#{oldrev},newrev=#{newrev},ref=#{ref}/))
perform
end
end
end
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