Commit 5c9561e7 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'rails-logger-cop-23' into 'master'

Use applogger in new note worker

See merge request gitlab-org/gitlab!32213
parents e0f69a1d eb985075
...@@ -16,7 +16,7 @@ class NewNoteWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -16,7 +16,7 @@ class NewNoteWorker # rubocop:disable Scalability/IdempotentWorker
NotificationService.new.new_note(note) unless skip_notification?(note) NotificationService.new.new_note(note) unless skip_notification?(note)
Notes::PostProcessService.new(note).execute Notes::PostProcessService.new(note).execute
else else
Rails.logger.error("NewNoteWorker: couldn't find note with ID=#{note_id}, skipping job") # rubocop:disable Gitlab/RailsLogger Gitlab::AppLogger.error("NewNoteWorker: couldn't find note with ID=#{note_id}, skipping job")
end end
end end
......
---
title: Use applogger in new note worker
merge_request: 32213
author: Rajendra Kadam
type: fixed
...@@ -27,7 +27,7 @@ describe NewNoteWorker do ...@@ -27,7 +27,7 @@ describe NewNoteWorker do
let(:unexistent_note_id) { non_existing_record_id } let(:unexistent_note_id) { non_existing_record_id }
it 'logs NewNoteWorker process skipping' do it 'logs NewNoteWorker process skipping' do
expect(Rails.logger).to receive(:error) expect(Gitlab::AppLogger).to receive(:error)
.with("NewNoteWorker: couldn't find note with ID=#{unexistent_note_id}, skipping job") .with("NewNoteWorker: couldn't find note with ID=#{unexistent_note_id}, skipping job")
described_class.new.perform(unexistent_note_id) described_class.new.perform(unexistent_note_id)
......
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