diff options
author | Christoph Helma <helma@in-silico.de> | 2010-02-09 12:09:30 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2010-02-09 12:09:30 +0100 |
commit | 63172223d1aeadd38850c85de668d1b1b333ceb0 (patch) | |
tree | 4cc86888637f1b07a3bded7c77186ca96378ac58 /lib/dataset.rb | |
parent | 9b136b483eb826bc25fb60d4e33b1e8128a85559 (diff) |
Dataset service with tasks
Diffstat (limited to 'lib/dataset.rb')
-rw-r--r-- | lib/dataset.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb index bd523a3..19572f6 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -156,7 +156,18 @@ module OpenTox end def save - RestClient.post(@@config[:services]["opentox-dataset"], self.rdf, :content_type => "application/rdf+xml").to_s + LOGGER.debug "Saving dataset" + task_uri = RestClient.post(@@config[:services]["opentox-dataset"], self.rdf, :content_type => "application/rdf+xml").to_s + task = OpenTox::Task.find(task_uri) + LOGGER.debug "Waiting for task #{task_uri}" + task.wait_for_completion + LOGGER.debug "Dataset task #{task_uri} completed" + if task.failed? + LOGGER.error "Saving dataset failed" + task.failed + exit + end + task.resource end def to_yaml |