From f955bce3a9eb0eacdfc9924fa3cd68bbd3127bc8 Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 15 Feb 2012 15:11:00 +0100 Subject: uncomment code http://goo.gl/ybSy3 after positive test --- lazar.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lazar.rb') diff --git a/lazar.rb b/lazar.rb index d8cffe0..e4ae4c9 100644 --- a/lazar.rb +++ b/lazar.rb @@ -152,10 +152,10 @@ post '/:id/?' do response['Content-Type'] = 'text/uri-list' if compound_uri - #cache = PredictionCache.find(:model_uri => lazar.uri, :compound_uri => compound_uri).first - #if cache and uri_available?(cache.dataset_uri) - # return cache.dataset_uri - #else + cache = PredictionCache.find(:model_uri => lazar.uri, :compound_uri => compound_uri).first + if cache and uri_available?(cache.dataset_uri) + return cache.dataset_uri + else begin prediction_uri = lazar.predict(compound_uri,true,@subjectid).uri PredictionCache.create(:model_uri => lazar.uri, :compound_uri => compound_uri, :dataset_uri => prediction_uri) @@ -164,7 +164,7 @@ post '/:id/?' do LOGGER.error "Lazar prediction failed for #{compound_uri} with #{$!} " raise "Prediction of #{compound_uri} with #{lazar.uri} failed." end - #end + end elsif dataset_uri task = OpenTox::Task.create("Predict dataset",url_for("/#{lazar.id}", :full)) do |task| lazar.predict_dataset(dataset_uri, @subjectid, task).uri -- cgit v1.2.3