debian-mirror-gitlab/app/services/projects/update_statistics_service.rb
2019-09-30 21:07:59 +05:30

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