diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /config/initializers/postgres_partitioning.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'config/initializers/postgres_partitioning.rb')
-rw-r--r-- | config/initializers/postgres_partitioning.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/config/initializers/postgres_partitioning.rb b/config/initializers/postgres_partitioning.rb index 787e46c2405..d4be1e7670d 100644 --- a/config/initializers/postgres_partitioning.rb +++ b/config/initializers/postgres_partitioning.rb @@ -3,11 +3,15 @@ # Make sure we have loaded partitioned models here # (even with eager loading disabled). -Gitlab::Database::Partitioning::PartitionCreator.register(AuditEvent) -Gitlab::Database::Partitioning::PartitionCreator.register(WebHookLog) +Gitlab::Database::Partitioning::PartitionManager.register(AuditEvent) +Gitlab::Database::Partitioning::PartitionManager.register(WebHookLog) + +if Gitlab.ee? + Gitlab::Database::Partitioning::PartitionManager.register(IncidentManagement::PendingEscalations::Alert) +end begin - Gitlab::Database::Partitioning::PartitionCreator.new.create_partitions unless ENV['DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP'] + Gitlab::Database::Partitioning::PartitionManager.new.sync_partitions unless ENV['DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP'] rescue ActiveRecord::ActiveRecordError, PG::Error # ignore - happens when Rake tasks yet have to create a database, e.g. for testing end |