gitlab-org--gitlab-foss/app/services/projects/update_statistics_service.rb

20 lines
400 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Projects
class UpdateStatisticsService < BaseService
def execute
2019-02-13 17:38:11 -05:00
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