Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Last active October 31, 2019 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcoyne/e588b17557132666441a41dca6ef5e6c to your computer and use it in GitHub Desktop.
Save jcoyne/e588b17557132666441a41dca6ef5e6c to your computer and use it in GitHub Desktop.
Check for complete results.
def check(id)
result = Dor::Services::Client::AsyncResult.new(url: "https://dor-services-prod.stanford.edu/v1/background_job_results/#{id}")
return 'good' if result.complete? && result.errors.nil?
return 'not complete' if !result.complete?
result.errors
end
ids = ["18157", "18108"]
ids.each { |id| puts id if check(id) == 'good' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment