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."