Last active
April 12, 2025 15:48
-
-
Save pmatsinopoulos/a11a2ab5887629a1a600be54c1e75c36 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class CreateUserJob < ApplicationJob | |
queue_as :default | |
def perform(user_email) | |
puts "************** #{provider_job_id} About to create user: #{user_email}" | |
found = User.find_by(email: user_email) | |
return if found | |
sleep rand(5..10) # simulate some complex business logic to build the User object properly | |
User.create!(email: user_email) | |
puts "................ #{provider_job_id} FINISHED #{provider_job_id}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment