diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /app/models/namespace | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'app/models/namespace')
-rw-r--r-- | app/models/namespace/aggregation_schedule.rb | 2 | ||||
-rw-r--r-- | app/models/namespace/root_storage_statistics.rb | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/app/models/namespace/aggregation_schedule.rb b/app/models/namespace/aggregation_schedule.rb index e08c08f9ced..6c977505f17 100644 --- a/app/models/namespace/aggregation_schedule.rb +++ b/app/models/namespace/aggregation_schedule.rb @@ -14,7 +14,7 @@ class Namespace::AggregationSchedule < ApplicationRecord def default_lease_timeout if Feature.enabled?(:reduce_aggregation_schedule_lease, namespace.root_ancestor) - 2.minutes.to_i + ::Gitlab::CurrentSettings.namespace_aggregation_schedule_lease_duration_in_seconds else 30.minutes.to_i end diff --git a/app/models/namespace/root_storage_statistics.rb b/app/models/namespace/root_storage_statistics.rb index 0443e1d9231..8af0cf2767c 100644 --- a/app/models/namespace/root_storage_statistics.rb +++ b/app/models/namespace/root_storage_statistics.rb @@ -21,7 +21,7 @@ class Namespace::RootStorageStatistics < ApplicationRecord scope :for_namespace_ids, ->(namespace_ids) { where(namespace_id: namespace_ids) } - delegate :all_projects, to: :namespace + delegate :all_projects_except_soft_deleted, to: :namespace enum notification_level: { storage_remaining: 100, @@ -60,8 +60,6 @@ class Namespace::RootStorageStatistics < ApplicationRecord end def attributes_for_forks_statistics - return {} unless ::Feature.enabled?(:root_storage_statistics_calculate_forks, namespace) - visibility_levels_to_storage_size_columns = { Gitlab::VisibilityLevel::PRIVATE => :private_forks_storage_size, Gitlab::VisibilityLevel::INTERNAL => :internal_forks_storage_size, @@ -78,7 +76,7 @@ class Namespace::RootStorageStatistics < ApplicationRecord end def for_forks_statistics - all_projects + all_projects_except_soft_deleted .joins([:statistics, :fork_network]) .where('fork_networks.root_project_id != projects.id') .group('projects.visibility_level') @@ -94,7 +92,7 @@ class Namespace::RootStorageStatistics < ApplicationRecord end def from_project_statistics - all_projects + all_projects_except_soft_deleted .joins('INNER JOIN project_statistics ps ON ps.project_id = projects.id') .select( 'COALESCE(SUM(ps.storage_size), 0) AS storage_size', |