Class: Gitlab::Uploads::MigrationHelper
- Inherits:
-
Object
- Object
- Gitlab::Uploads::MigrationHelper
- Defined in:
- lib/gitlab/uploads/migration_helper.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(args, logger) ⇒ MigrationHelper
constructor
A new instance of MigrationHelper.
- #migrate_to_local_storage ⇒ Object
- #migrate_to_remote_storage ⇒ Object
Constructor Details
#initialize(args, logger) ⇒ MigrationHelper
Returns a new instance of MigrationHelper.
8 9 10 |
# File 'lib/gitlab/uploads/migration_helper.rb', line 8 def initialize(args, logger) prepare_variables(args, logger) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/gitlab/uploads/migration_helper.rb', line 6 def logger @logger end |
Instance Method Details
#migrate_to_local_storage ⇒ Object
18 19 20 21 22 |
# File 'lib/gitlab/uploads/migration_helper.rb', line 18 def migrate_to_local_storage @to_store = ObjectStorage::Store::LOCAL uploads(ObjectStorage::Store::REMOTE).each_batch(of: batch_size, &method(:enqueue_batch)) end |
#migrate_to_remote_storage ⇒ Object
12 13 14 15 16 |
# File 'lib/gitlab/uploads/migration_helper.rb', line 12 def migrate_to_remote_storage @to_store = ObjectStorage::Store::REMOTE uploads.each_batch(of: batch_size, &method(:enqueue_batch)) end |