lib/rocket_job/sliced/input.rb
# Upload sliced range of integer requests as a an arrays of start and end ids
#
# Returns [Integer] the number of slices uploaded
#
# Uploads one range per slice so that the response can return multiple records
# for each slice processed
#
# Example
#   job.slice_size = 100
#   job.record_count = job.upload_integer_range(200, 421)
#
#   # Equivalent to calling:
#   job.record_count = job.insert([200,299])
#   job.record_count += job.insert([300,399])
#   job.record_count += job.insert([400,421])
Upload sliced range of integer requests as a an arrays of start and end ids
Returns [Integer] the number of slices uploaded

Uploads one range per slice so that the response can return multiple records
for each slice processed




Upload sliced range of integer requests as a an arrays of start and end ids Returns [ Integer ] the number of slices uploaded Uploads one range per slice so that the response can return multiple records for each slice processed
def upload_integer_range(start_id, last_id)
        create_indexes
        count = 0
        while start_id <= last_id
          end_id = start_id + slice_size - 1
          end_id = last_id if end_id > last_id
          create!(records: [[start_id, end_id]])
          start_id += slice_size
          count    += 1
        end
        count
      end
def upload_integer_range ( start_id , last_id ) create_indexes count = 0 while start_id <= last_id end_id = start_id + slice_size - 1 end_id = last_id if end_id > last_id create! ( records : [ [ start_id , end_id ] ] ) start_id += slice_size count += 1 end count end
Upload sliced range of integer requests as a an arrays of start and end ids
Returns [Integer] the number of slices uploaded
Upload sliced range of integer requests as a an arrays of start and end ids Returns [ Integer ] the number of slices uploaded
start_id
last_id