Class: RewardWorkers::SyncUserLoyalty

Inherits:
ApplicationWorker show all
Defined in:
app/workers/reward_workers/sync_user_loyalty.rb

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#perform(user_id, expiry_date = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'app/workers/reward_workers/sync_user_loyalty.rb', line 9

def perform(user_id, expiry_date = nil)
  return if user_id.blank?

  if expiry_date.present?
    update_expiry_dates(user_id, expiry_date)
  else
    update_loyalty_level(user_id)
  end
end