diff options
| author | Robert | 2017-10-19 20:45:50 +0200 |
|---|---|---|
| committer | Robert | 2017-10-24 15:28:44 +0200 |
| commit | d351eab8ceea2bc7609e800e62bfb90c000cff5c (patch) | |
| tree | f386dade385bc18706436b182150b1a9e8958718 /app/workers | |
| parent | 7f3b2aa1a1c4a2e051e1b2d3d3b57ab646b01a44 (diff) | |
| download | chouette-core-d351eab8ceea2bc7609e800e62bfb90c000cff5c.tar.bz2 | |
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)
Diffstat (limited to 'app/workers')
| -rw-r--r-- | app/workers/workbench_import_worker.rb | 18 |
1 files changed, 13 insertions, 5 deletions
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')) |
