2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Projects
|
|
|
|
class UpdateStatisticsService < BaseService
|
|
|
|
def execute
|
2019-09-04 21:01:54 +05:30
|
|
|
return unless project
|
2019-07-31 22:56:46 +05:30
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
Rails.logger.info("Updating statistics for project #{project.id}") # rubocop:disable Gitlab/RailsLogger
|
2019-07-31 22:56:46 +05:30
|
|
|
|
|
|
|
project.statistics.refresh!(only: statistics.map(&:to_sym))
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def statistics
|
|
|
|
params[:statistics]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|