diff options
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/1_settings.rb | 3 | ||||
-rw-r--r-- | config/initializers/postgres_partitioning.rb | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 597b5626435..9f3d813fcd2 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -503,6 +503,9 @@ Settings.cron_jobs['authorized_project_update_periodic_recalculate_worker']['job Settings.cron_jobs['update_container_registry_info_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['update_container_registry_info_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['update_container_registry_info_worker']['job_class'] = 'UpdateContainerRegistryInfoWorker' +Settings.cron_jobs['postgres_dynamic_partitions_creator'] ||= Settingslogic.new({}) +Settings.cron_jobs['postgres_dynamic_partitions_creator']['cron'] ||= '21 */6 * * *' +Settings.cron_jobs['postgres_dynamic_partitions_creator']['job_class'] ||= 'PartitionCreationWorker' Gitlab.ee do Settings.cron_jobs['adjourned_group_deletion_worker'] ||= Settingslogic.new({}) diff --git a/config/initializers/postgres_partitioning.rb b/config/initializers/postgres_partitioning.rb new file mode 100644 index 00000000000..6c8a72d9bd5 --- /dev/null +++ b/config/initializers/postgres_partitioning.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Make sure we have loaded partitioned models here +# (even with eager loading disabled). + +begin + Gitlab::Database::Partitioning::PartitionCreator.new.create_partitions +rescue ActiveRecord::ActiveRecordError, PG::Error + # ignore - happens when Rake tasks yet have to create a database, e.g. for testing +end |