diff options
Diffstat (limited to 'app/models/concerns/update_project_statistics.rb')
-rw-r--r-- | app/models/concerns/update_project_statistics.rb | 14 |
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) |