Class: Users::UpdateUserSignInTimestampsWorker

Inherits:
ApplicationWorker show all
Defined in:
app/workers/users/update_user_sign_in_timestamps_worker.rb

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

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: Time.current,
  )
rescue StandardError => e
  APMErrorHandler.report(e)
  raise e
end