diff options
Diffstat (limited to 'app/models/project_statistics.rb')
-rw-r--r-- | app/models/project_statistics.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/project_statistics.rb b/app/models/project_statistics.rb index 99cec647a98..95fc135f38f 100644 --- a/app/models/project_statistics.rb +++ b/app/models/project_statistics.rb @@ -19,7 +19,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].freeze + COLUMNS_TO_REFRESH = [:repository_size, :wiki_size, :lfs_objects_size, :commit_count, :snippets_size, :uploads_size, :container_registry_size].freeze INCREMENTABLE_COLUMNS = { build_artifacts_size: %i[storage_size], packages_size: %i[storage_size], @@ -76,6 +76,12 @@ class ProjectStatistics < ApplicationRecord self.uploads_size = project.uploads.sum(:size) end + def update_container_registry_size + return unless Feature.enabled?(:container_registry_project_statistics, project) + + self.container_registry_size = project.container_repositories_size || 0 + end + # `wiki_size` and `snippets_size` have no default value in the database # and the column can be nil. # This means that, when the columns were added, all rows had nil |