6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/eco/api/common/version_patches/ecoportal_api/external_people.rb', line 6
def job
operation = Common::BatchOperation.new("/people", person_class, logger: client.logger)
yield operation
job_id = create_job(operation)
status = wait_for_job_completion(job_id)
if status&.complete?
operation.process_response job_result(job_id, operation)
else
raise "Job `#{job_id}` not complete. Probably timeout after #{JOB_TIMEOUT + 60} seconds. Current status: #{status}"
end
end
|