summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-02-09 10:26:16 +0100
committerAndreas Maunz <andreas@maunz.de>2012-02-09 10:26:16 +0100
commitc80b7ac28dce2df193fb61c042b0563f35b48012 (patch)
treefe20f75eeae4ea9aa5cc9904c322e239441704fc
parent41a5a6a85fa97d5d9a6495c36df3762b8f5f36c0 (diff)
Fixed tempfile deletion
-rw-r--r--feature_selection.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/feature_selection.rb b/feature_selection.rb
index efda812..d375a0e 100644
--- a/feature_selection.rb
+++ b/feature_selection.rb
@@ -71,9 +71,11 @@ post '/feature_selection/rfe/?' do
task = OpenTox::Task.create("Recursive Feature Elimination", url_for('/feature_selection',:full)) do |task|
r_result_file = OpenTox::Algorithm::FeatureSelection.rfe( { :ds_csv_file => tf_ds.path, :prediction_feature => prediction_feature, :fds_csv_file => tf_fds.path, :del_missing => del_missing } )
r_result_uri = OpenTox::Dataset.create_from_csv_file(r_result_file).uri
- tf_ds.close!; tf_fds.close!
- tf_ds.delete; tf_fds.delete
- File.unlink(r_result_file)
+ begin
+ tf_ds.close!; tf_fds.close!
+ File.unlink(r_result_file)
+ rescue
+ end
r_result_uri
end
response['Content-Type'] = 'text/uri-list'