diff options
-rw-r--r-- | lib/config/config_ru.rb | 1 | ||||
-rw-r--r-- | lib/dataset.rb | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/config/config_ru.rb b/lib/config/config_ru.rb index 3720ef3..1d32c7e 100644 --- a/lib/config/config_ru.rb +++ b/lib/config/config_ru.rb @@ -10,6 +10,7 @@ $stdout.reopen(log) $stderr.reopen(log) $stdout.sync = true $stderr.sync = true +set :logging, false set :raise_errors, true ['public','tmp'].each do |dir| 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 |