Class: BulkImports::RelationBatchExportService
- Inherits:
-
Object
- Object
- BulkImports::RelationBatchExportService
- Includes:
- Gitlab::ImportExport::CommandLineUtil
- Defined in:
- app/services/bulk_imports/relation_batch_export_service.rb
Constant Summary
Constants included from Gitlab::ImportExport::CommandLineUtil
Gitlab::ImportExport::CommandLineUtil::CLEAN_DIR_IGNORE_FILE_NAMES, Gitlab::ImportExport::CommandLineUtil::CommandLineUtilError, Gitlab::ImportExport::CommandLineUtil::DEFAULT_DIR_MODE, Gitlab::ImportExport::CommandLineUtil::FileOversizedError, Gitlab::ImportExport::CommandLineUtil::HardLinkError, Gitlab::ImportExport::CommandLineUtil::UNTAR_MASK
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(user, batch) ⇒ RelationBatchExportService
constructor
A new instance of RelationBatchExportService.
Methods included from Gitlab::ImportExport::CommandLineUtil
#gunzip, #gzip, #gzip_with_options, #mkdir_p, #tar_cf, #tar_czf, #untar_xf, #untar_zxf
Constructor Details
#initialize(user, batch) ⇒ RelationBatchExportService
Returns a new instance of RelationBatchExportService.
7 8 9 10 11 |
# File 'app/services/bulk_imports/relation_batch_export_service.rb', line 7 def initialize(user, batch) @user = user @batch = batch @config = FileTransfer.config_for(portable) end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/services/bulk_imports/relation_batch_export_service.rb', line 13 def execute start_batch! batch_ids = relation_batch_ids return if batch_ids.blank? export_service.export_batch(batch_ids) compress_exported_relation upload_compressed_file export.touch finish_batch! ensure FileUtils.remove_entry(export_path) end |