aboutsummaryrefslogtreecommitdiffstats
path: root/app/workers
diff options
context:
space:
mode:
authorTeddy Wing2017-10-30 14:59:04 +0100
committerTeddy Wing2017-10-30 17:48:58 +0100
commit17dcf8fe67972f6287fdac40a4477ef8b63ae1b9 (patch)
tree4815308c04760ccca87bf3e1104af8bf039a674c /app/workers
parent48a0641066d1b7c534b45e36c921e4b2a708138a (diff)
downloadchouette-core-17dcf8fe67972f6287fdac40a4477ef8b63ae1b9.tar.bz2
ComplianceControlSetCopyWorker: Call Java validation API
Call the Java API URL to launch a validation after having copied the `ComplianceControlSet` into a `ComplianceCheckSet`. Copied the format with error logging from `NetexImport#launch_java_import`. In the test, make the ID variables global by putting them in `let`s. Add `config.iev_url` to the Rails `test` environment so that we can access this from our tests. TODO: I just realised I'm sending the wrong ID. I should be sending the check set ID. Refs #4782
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/compliance_control_set_copy_worker.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/workers/compliance_control_set_copy_worker.rb b/app/workers/compliance_control_set_copy_worker.rb
index ec47651ea..92ec5b903 100644
--- a/app/workers/compliance_control_set_copy_worker.rb
+++ b/app/workers/compliance_control_set_copy_worker.rb
@@ -3,5 +3,12 @@ class ComplianceControlSetCopyWorker
def perform(control_set_id, referential_id)
ComplianceControlSetCopier.new.copy(control_set_id, referential_id)
+
+ begin
+ Net::HTTP.get(URI("#{Rails.configuration.iev_url}/boiv_iev/referentials/validator/new?id=#{control_set_id}"))
+ rescue Exception => e
+ logger.error "IEV server error : #{e.message}"
+ logger.error e.backtrace.inspect
+ end
end
end