From 00fc7dcadc20d8eda51e20b33905b75197d440e6 Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 5 Dec 2022 09:04:49 +0530 Subject: [PATCH] Updated Constant Name to LEGACY_INCREMENTABLE_COLUMNS Signed-off-by: Adithya Krishna --- app/models/project_statistics.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/project_statistics.rb b/app/models/project_statistics.rb index fb0ad178c91425..7f7b2724f745ee 100644 --- a/app/models/project_statistics.rb +++ b/app/models/project_statistics.rb @@ -22,7 +22,7 @@ class ProjectStatistics < ApplicationRecord before_save :update_storage_size COLUMNS_TO_REFRESH = [:repository_size, :wiki_size, :lfs_objects_size, :commit_count, :snippets_size, :uploads_size, :container_registry_size].freeze - INCREMENTABLE_COLUMNS = { + LEGACY_INCREMENTABLE_COLUMNS = { packages_size: %i[storage_size], # remove this along with packages_size_counter_attribute pipeline_artifacts_size: %i[storage_size], snippets_size: %i[storage_size] @@ -123,7 +123,7 @@ def refresh_storage_size! # For counter attributes, storage_size will be refreshed after the counter is flushed, # through counter_attribute_after_flush # - # For non-counter attributes, storage_size is updated depending on key => [columns] in INCREMENTABLE_COLUMNS + # For non-counter attributes, storage_size is updated depending on key => [columns] in LEGACY_INCREMENTABLE_COLUMNS def self.increment_statistic(project, key, amount) project.statistics.try do |project_statistics| project_statistics.increment_statistic(key, amount) @@ -151,7 +151,7 @@ def legacy_increment_statistic(key, amount) private def incrementable_attribute?(key) - INCREMENTABLE_COLUMNS.key?(key) || counter_attribute_enabled?(key) + LEGACY_INCREMENTABLE_COLUMNS.key?(key) || counter_attribute_enabled?(key) end def storage_size_components @@ -164,7 +164,7 @@ def storage_size_sum def increment_columns!(key, amount) increments = { key => amount } - additional = INCREMENTABLE_COLUMNS.fetch(key, []) + additional = LEGACY_INCREMENTABLE_COLUMNS.fetch(key, []) additional.each do |column| increments[column] = amount end -- GitLab