gitlab-org--gitlab-foss/app/services/projects/update_statistics_service.rb
Mayra Cabrera 0ab89d8e36 Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
2019-07-10 19:26:47 +00:00

19 lines
400 B
Ruby

# frozen_string_literal: true
module Projects
class UpdateStatisticsService < BaseService
def execute
return unless project
Rails.logger.info("Updating statistics for project #{project.id}") # rubocop:disable Gitlab/RailsLogger
project.statistics.refresh!(only: statistics.map(&:to_sym))
end
private
def statistics
params[:statistics]
end
end
end