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 | |
parent | 9b136b483eb826bc25fb60d4e33b1e8128a85559 (diff) |
Dataset service with tasks
Diffstat (limited to 'lib')
-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 |