Skip to content
This repository was archived by the owner on Jun 6, 2018. It is now read-only.

Commit e1e81fc

Browse files
committed
Merge pull request #2 from leifg/fix_bug_large_queries
CSV parse issue on EC2 instance when using Executrix
2 parents a817c85 + c0e8d0c commit e1e81fc

4 files changed

Lines changed: 10 additions & 13 deletions

File tree

lib/executrix.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def query(sobject, query)
4444
batch_id = @connection.add_query(job_id, query)
4545
@connection.close_job job_id
4646
batch_reference = Executrix::Batch.new @connection, job_id, batch_id
47-
batch_reference.init_result_id
4847
batch_reference.final_status
4948
end
5049

lib/executrix/batch.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,17 @@ def status
3434
@connection.query_batch @job_id, @batch_id
3535
end
3636

37-
# only needed for query
38-
def init_result_id
39-
max_retries = 5
40-
retry_count = 0
41-
while @result_id.nil? && retry_count < max_retries
42-
@result_id = @connection.query_batch_result_id(@job_id, @batch_id)[:result]
43-
retry_count += 1
44-
end
45-
end
46-
4737
def results
38+
init_result_id
4839
@connection.query_batch_result_data(@job_id, @batch_id, @result_id)
4940
end
41+
42+
private
43+
def init_result_id
44+
result_raw = @connection.query_batch_result_id(@job_id, @batch_id)
45+
if result_raw
46+
@result_id = result_raw[:result]
47+
end
48+
end
5049
end
5150
end

lib/executrix/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Executrix
2-
VERSION = '1.1.2'
2+
VERSION = '1.1.3'
33
end

spec/lib/executrix_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
empty_connection.should_receive(:create_job).ordered
5757
empty_connection.should_receive(:add_query).ordered
5858
empty_connection.should_receive(:close_job).ordered
59-
empty_batch.should_receive(:init_result_id).ordered
6059
empty_batch.should_receive(:final_status).ordered
6160
s.query(sobject_input, query_input)
6261
end

0 commit comments

Comments
 (0)