summaryrefslogtreecommitdiff
path: root/app/models/concerns/update_project_statistics.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /app/models/concerns/update_project_statistics.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/models/concerns/update_project_statistics.rb')
-rw-r--r--app/models/concerns/update_project_statistics.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/models/concerns/update_project_statistics.rb b/app/models/concerns/update_project_statistics.rb
index a84fb1cf56d..6cf012680d8 100644
--- a/app/models/concerns/update_project_statistics.rb
+++ b/app/models/concerns/update_project_statistics.rb
@@ -68,21 +68,11 @@ module UpdateProjectStatistics
def schedule_update_project_statistic(delta)
return if delta.zero?
+ return if project.nil?
- if Feature.enabled?(:update_project_statistics_after_commit, default_enabled: true)
- # Update ProjectStatistics after the transaction
- run_after_commit do
- ProjectStatistics.increment_statistic(
- project_id, self.class.project_statistics_name, delta)
- end
- else
- # Use legacy-way to update within transaction
+ run_after_commit do
ProjectStatistics.increment_statistic(
project_id, self.class.project_statistics_name, delta)
- end
-
- run_after_commit do
- next if project.nil?
Namespaces::ScheduleAggregationWorker.perform_async(
project.namespace_id)