From 3891deaba4e4933ccf0ad9f8ba372eba5fe1e9ae Mon Sep 17 00:00:00 2001 From: djoumbou Date: Wed, 9 Mar 2016 21:42:31 -0700 Subject: [PATCH] - Updated ClassyFireAPI.submit_query_input_in_chunks --- lib/classyfire_api.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/classyfire_api.rb b/lib/classyfire_api.rb index dffe982..7c5e780 100644 --- a/lib/classyfire_api.rb +++ b/lib/classyfire_api.rb @@ -175,15 +175,17 @@ module ClassyFireAPI while i < initial_nr_of_jobs title = File.basename(absolute_path).split(".")[0] + "_yannick" + "_part_#{i}" - begin - puts "submitting #{title}" - q = submit_query(title,subdivised_groups[i-1].join("\n"),type) - query_ids << JSON.parse(q)['id'] - rescue Exception => e - puts e.message - puts e.backtrace.inspect + if i <= subdivised_groups.length + begin + puts "submitting #{title}" + q = submit_query(title,subdivised_groups[i-1].join("\n"),type) + query_ids << JSON.parse(q)['id'] + rescue Exception => e + puts e.message + puts e.backtrace.inspect + end + i = i + 1 end - i = i + 1 end puts "Going to sleep at #{Time.now - @start_time} for #{sleeping_time} s." @@ -202,7 +204,6 @@ module ClassyFireAPI puts e.message puts e.backtrace.inspect end - end i = k puts "Going to sleep at #{Time.now - @start_time} for #{sleeping_time} s."