This repository was archived by the owner on Jun 6, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
5150end
Original file line number Diff line number Diff line change 11module Executrix
2- VERSION = '1.1.2 '
2+ VERSION = '1.1.3 '
33end
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments