Class: Database::BatchedBackgroundMigrationsFinder
- Inherits:
-
Object
- Object
- Database::BatchedBackgroundMigrationsFinder
- Defined in:
- app/finders/database/batched_background_migrations_finder.rb
Constant Summary collapse
- RETURNED_MIGRATIONS =
20
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(params:) ⇒ BatchedBackgroundMigrationsFinder
constructor
A new instance of BatchedBackgroundMigrationsFinder.
Constructor Details
#initialize(params:) ⇒ BatchedBackgroundMigrationsFinder
Returns a new instance of BatchedBackgroundMigrationsFinder.
7 8 9 |
# File 'app/finders/database/batched_background_migrations_finder.rb', line 7 def initialize(params:) @params = params end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/finders/database/batched_background_migrations_finder.rb', line 11 def execute raise ArgumentError, 'database parameter is required' if params[:database].blank? return batched_migration_class.none unless Gitlab::Database.has_config?(database_name) @migrations = migrations filter_by_job_class_name @migrations.limit(RETURNED_MIGRATIONS) end |