summaryrefslogtreecommitdiff
path: root/app/models/project_statistics.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-07 15:08:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-07 15:08:49 +0000
commita93bf027c2619af8c11b030414c339346f13ead6 (patch)
tree283f1b4096a255a535a79c60ebe2445a9e5df4d2 /app/models/project_statistics.rb
parent0254867cf0f3341fd63cc6da07290f1da91f99ef (diff)
downloadgitlab-ce-a93bf027c2619af8c11b030414c339346f13ead6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_statistics.rb')
-rw-r--r--app/models/project_statistics.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/project_statistics.rb b/app/models/project_statistics.rb
index 1d8e72c902a..55c7c6ab682 100644
--- a/app/models/project_statistics.rb
+++ b/app/models/project_statistics.rb
@@ -75,7 +75,12 @@ class ProjectStatistics < ApplicationRecord
end
def update_storage_size
- self.storage_size = repository_size + wiki_size + lfs_objects_size + build_artifacts_size + packages_size + snippets_size
+ storage_size = repository_size + wiki_size + lfs_objects_size + build_artifacts_size + packages_size
+ # The `snippets_size` column was added on 20200622095419 but db/post_migrate/20190527194900_schedule_calculate_wiki_sizes.rb
+ # might try to update project statistics before the `snippets_size` column has been created.
+ storage_size += snippets_size if self.class.column_names.include?('snippets_size')
+
+ self.storage_size = storage_size
end
# Since this incremental update method does not call update_storage_size above,