diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /app/services/loose_foreign_keys/process_deleted_records_service.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'app/services/loose_foreign_keys/process_deleted_records_service.rb')
-rw-r--r-- | app/services/loose_foreign_keys/process_deleted_records_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/loose_foreign_keys/process_deleted_records_service.rb b/app/services/loose_foreign_keys/process_deleted_records_service.rb index 8700276c982..e0c9c19f5b9 100644 --- a/app/services/loose_foreign_keys/process_deleted_records_service.rb +++ b/app/services/loose_foreign_keys/process_deleted_records_service.rb @@ -4,13 +4,13 @@ module LooseForeignKeys class ProcessDeletedRecordsService BATCH_SIZE = 1000 - def initialize(connection:) + def initialize(connection:, modification_tracker: LooseForeignKeys::ModificationTracker.new) @connection = connection + @modification_tracker = modification_tracker end def execute raised_error = false - modification_tracker = ModificationTracker.new tracked_tables.cycle do |table| records = load_batch_for_table(table) @@ -54,7 +54,7 @@ module LooseForeignKeys private - attr_reader :connection + attr_reader :connection, :modification_tracker def db_config_name ::Gitlab::Database.db_config_name(connection) |