Class: Users::UpdateUserSignInTimestampsWorker
- Inherits:
-
ApplicationWorker
- Object
- ApplicationWorker
- Users::UpdateUserSignInTimestampsWorker
- Defined in:
- app/workers/users/update_user_sign_in_timestamps_worker.rb
Instance Method Summary collapse
Methods inherited from ApplicationWorker
Instance Method Details
#perform(user_id) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/workers/users/update_user_sign_in_timestamps_worker.rb', line 8 def perform(user_id) return if user_id.blank? user = User.find_by(id: user_id) return if user.nil? user.update!( last_sign_in_at: user.current_sign_in_at, current_sign_in_at: Time.current, ) rescue StandardError => e APMErrorHandler.report(e) raise e end |