Created
December 30, 2022 02:55
-
-
Save r3cha/37f7fb9af1609bad53272c75e6d8d6b6 to your computer and use it in GitHub Desktop.
some code
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 perform(url) | |
return unless url | |
response = HTTParty.get(url) | |
return unless response.success? | |
data = JSON.parse(response.body) | |
return unless data['results'] | |
data['results'].each do |test| | |
create_test(test) unless Test.find_by(pgs_id: test['id']) | |
end | |
ParsePgsCatalogWorker.perform_async(data['next']) if data['next'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment