From d351eab8ceea2bc7609e800e62bfb90c000cff5c Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 19 Oct 2017 20:45:50 +0200 Subject: Refs: #4633@0.5h; WorkbenchImportWorker implements message creation for spurious directories - Speced and implemented Missing: - Exact message parameters (change key from xxx, how to add names of spurious directories) --- app/workers/workbench_import_worker.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'app/workers') diff --git a/app/workers/workbench_import_worker.rb b/app/workers/workbench_import_worker.rb index b89ba19d8..ef95cad51 100644 --- a/app/workers/workbench_import_worker.rb +++ b/app/workers/workbench_import_worker.rb @@ -48,11 +48,19 @@ class WorkbenchImportWorker raise end - def upload_entry_group entry_pair, element_count - @workbench_import.update( current_step: element_count.succ ) - # status = retry_service.execute(&upload_entry_group_proc(entry_pair)) - eg_name = entry_pair.name - eg_stream = entry_pair.stream + def update_object_state entry, count + @workbench_import.update( current_step: count ) + # TODO: Determine the other attributes of the message, especially how to add the names + # of the spurious dirs entry.spurious + unless entry.spurious.empty? + @workbench_import.messages.create(criticity: :warning, message_key: 'xxx') + end + end + def upload_entry_group entry, element_count + update_object_state entry, element_count.succ + # status = retry_service.execute(&upload_entry_group_proc(entry)) + eg_name = entry.name + eg_stream = entry.stream FileUtils.mkdir_p(Rails.root.join('tmp', 'imports')) -- cgit v1.2.3