Commit e0c41305 authored by Gary Holtz's avatar Gary Holtz Committed by Nikola Milojevic

Pulling out logger accessor

parent d5bca724
......@@ -10,11 +10,15 @@ class MergeRequestMergeabilityCheckWorker
feature_category :code_review
idempotent!
def logger
Sidekiq.logger
end
def perform(merge_request_id)
merge_request = MergeRequest.find_by_id(merge_request_id)
unless merge_request
Sidekiq.logger.error(worker: self.class.name, message: "Failed to find merge request", merge_request_id: merge_request_id)
logger.error(worker: self.class.name, message: "Failed to find merge request", merge_request_id: merge_request_id)
return
end
......@@ -23,6 +27,6 @@ class MergeRequestMergeabilityCheckWorker
.new(merge_request)
.execute(recheck: false, retry_lease: false)
Sidekiq.logger.error(worker: self.class.name, message: "Failed to check mergeability of merge request: #{result.message}", merge_request_id: merge_request_id) if result.error?
logger.error(worker: self.class.name, message: "Failed to check mergeability of merge request: #{result.message}", merge_request_id: merge_request_id) if result.error?
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