From 2b54733514e1c6e91b0397c70b441fc7c92e1db5 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Mon, 20 Feb 2012 16:33:40 +0100 Subject: Support for progress (task) --- application.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application.rb') diff --git a/application.rb b/application.rb index f806271..735a4d1 100644 --- a/application.rb +++ b/application.rb @@ -361,13 +361,13 @@ post '/:id/pcdesc' do response['Content-Type'] = 'text/uri-list' raise "No PC type given" unless params["pc_type"] - task = OpenTox::Task.create("PC descriptor calculation for dataset ", @uri) do + task = OpenTox::Task.create("PC descriptor calculation for dataset ", @uri) do |task| types = params[:pc_type].split(",") if types.include?("joelib") Rjb.load(nil,["-Xmx64m"]) s = Rjb::import('JoelibFc') end - OpenTox::Algorithm.pc_descriptors( { :dataset_uri => @uri, :pc_type => params[:pc_type], :rjb => s } ) + OpenTox::Algorithm.pc_descriptors( { :dataset_uri => @uri, :pc_type => params[:pc_type], :rjb => s, :task => task } ) end raise OpenTox::ServiceUnavailableError.newtask.uri+"\n" if task.status == "Cancelled" halt 202,task.uri.to_s+"\n" -- cgit v1.2.3