Last active
October 31, 2019 20:50
-
-
Save jcoyne/e588b17557132666441a41dca6ef5e6c to your computer and use it in GitHub Desktop.
Check for complete results.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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