diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-04 18:10:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-04 18:10:03 +0000 |
commit | 24f8aa38dc0ddd3489f0c98d5dd0517096caf05e (patch) | |
tree | eaa46caaad6cb5b0e3f4b59ac930c7c2d36396ce /app/workers/bulk_imports | |
parent | be4b3134a282f7a8812306777abd2d3150deecdc (diff) | |
download | gitlab-ce-24f8aa38dc0ddd3489f0c98d5dd0517096caf05e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/bulk_imports')
-rw-r--r-- | app/workers/bulk_imports/relation_export_worker.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/workers/bulk_imports/relation_export_worker.rb b/app/workers/bulk_imports/relation_export_worker.rb new file mode 100644 index 00000000000..b7df9a3d0b0 --- /dev/null +++ b/app/workers/bulk_imports/relation_export_worker.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module BulkImports + class RelationExportWorker + include ApplicationWorker + include ExceptionBacktrace + + idempotent! + loggable_arguments 2, 3 + feature_category :importers + tags :exclude_from_kubernetes + sidekiq_options status_expiration: StuckExportJobsWorker::EXPORT_JOBS_EXPIRATION + + def perform(user_id, exportable_id, exportable_class, relation) + user = User.find(user_id) + exportable = exportable(exportable_id, exportable_class) + + RelationExportService.new(user, exportable, relation, jid).execute + end + + private + + def exportable(exportable_id, exportable_class) + exportable_class.classify.constantize.find(exportable_id) + end + end +end |