Class: ObjectStorage::MigrateUploadsWorker
- Inherits:
-
Object
- Object
- ObjectStorage::MigrateUploadsWorker
- Includes:
- ApplicationWorker, Report, ObjectStorageQueue
- Defined in:
- app/workers/object_storage/migrate_uploads_worker.rb
Defined Under Namespace
Modules: Report Classes: MigrationResult
Constant Summary collapse
- SanityCheckError =
Class.new(StandardError)
Constants included from ApplicationWorker
ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT
Constants included from Gitlab::Loggable
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Class Method Summary collapse
-
.enqueue!(uploads, to_store) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord.
Instance Method Summary collapse
-
#perform(*args) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord.
Methods included from Report
Methods included from Gitlab::Loggable
Methods included from Gitlab::SidekiqVersioning::Worker
Methods included from WorkerContext
Class Method Details
.enqueue!(uploads, to_store) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord
70 71 72 |
# File 'app/workers/object_storage/migrate_uploads_worker.rb', line 70 def self.enqueue!(uploads, to_store) perform_async(uploads.ids, to_store) end |
Instance Method Details
#perform(*args) ⇒ Object
rubocop: disable CodeReuse/ActiveRecord
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'app/workers/object_storage/migrate_uploads_worker.rb', line 76 def perform(*args) ids, to_store = retrieve_applicable_args!(args) @to_store = to_store uploads = Upload.preload(:model).where(id: ids) results = migrate(uploads) report!(results) rescue SanityCheckError => e # do not retry: the job is insane Gitlab::AppLogger.warn "#{self.class}: Sanity check error (#{e.})" end |