diff options
Diffstat (limited to 'app/controllers/repositories/git_http_controller.rb')
-rw-r--r-- | app/controllers/repositories/git_http_controller.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/repositories/git_http_controller.rb b/app/controllers/repositories/git_http_controller.rb index 9e134ba9526..118036de230 100644 --- a/app/controllers/repositories/git_http_controller.rb +++ b/app/controllers/repositories/git_http_controller.rb @@ -23,7 +23,7 @@ module Repositories # POST /foo/bar.git/git-upload-pack (git pull) def git_upload_pack - enqueue_fetch_statistics_update + update_fetch_statistics render_ok end @@ -76,12 +76,16 @@ module Repositories render plain: exception.message, status: :service_unavailable end - def enqueue_fetch_statistics_update + def update_fetch_statistics + return unless project return if Gitlab::Database.read_only? return unless repo_type.project? - return unless project&.daily_statistics_enabled? - ProjectDailyStatisticsWorker.perform_async(project.id) # rubocop:disable CodeReuse/Worker + if Feature.enabled?(:project_statistics_sync, project, default_enabled: true) + Projects::FetchStatisticsIncrementService.new(project).execute + else + ProjectDailyStatisticsWorker.perform_async(project.id) # rubocop:disable CodeReuse/Worker + end end def access |