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
|
|
|
|
2020-05-21 17:08:31 -04:00
|
|
|
Gitlab::AppLogger.info("Updating statistics for project #{project.id}")
|
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
|