class SyncJob def perform(user_id) user = User.find(user_id) Api.sync(user) rescue ActiveRecord::RecordNotFound nil rescue => e retry end end