diff options
Diffstat (limited to 'app/services/bulk_imports/relation_export_service.rb')
-rw-r--r-- | app/services/bulk_imports/relation_export_service.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/services/bulk_imports/relation_export_service.rb b/app/services/bulk_imports/relation_export_service.rb index ed71c09420b..91640496440 100644 --- a/app/services/bulk_imports/relation_export_service.rb +++ b/app/services/bulk_imports/relation_export_service.rb @@ -18,6 +18,7 @@ module BulkImports find_or_create_export! do |export| export.remove_existing_upload! export_service.execute + ensure_export_file_exists! compress_exported_relation upload_compressed_file(export) end @@ -91,5 +92,15 @@ module BulkImports export&.update(status_event: 'fail_op', error: exception.class, batched: false) end + + def exported_filepath + File.join(export_path, export_service.exported_filename) + end + + # Create empty file on disk + # if relation is empty and nothing was exported + def ensure_export_file_exists! + FileUtils.touch(exported_filepath) + end end end |