Class: ArchiveStorage::Jobs::QueueJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- ArchiveStorage::Jobs::QueueJob
- Defined in:
- lib/archive_storage/jobs/queue_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/archive_storage/jobs/queue_job.rb', line 21 def perform( = {}) = symbolize_keys() remaining = migration_limit() total = 0 ().each do || break if remaining && remaining <= 0 planner = Planner.new(**.merge(limit: remaining)) count = Migrator.new(planner: planner).enqueue_or_migrate! remaining -= count if remaining total += count end total end |