2019-04-05 09:07:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Projects
|
|
|
|
class UpdateStatisticsService < BaseService
|
|
|
|
def execute
|
2019-02-13 17:38:11 -05:00
|
|
|
return unless project
|
2019-04-05 09:07:09 -04:00
|
|
|
|
2019-07-10 15:26:47 -04:00
|
|
|
Rails.logger.info("Updating statistics for project #{project.id}") # rubocop:disable Gitlab/RailsLogger
|
2019-04-05 09:07:09 -04:00
|
|
|
|
|
|
|
project.statistics.refresh!(only: statistics.map(&:to_sym))
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def statistics
|
|
|
|
params[:statistics]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|