Skip to content

Commit

Permalink
Skip empty condition trigger, there is QR trigger.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinoppyd committed May 14, 2024
1 parent 61d83a5 commit 69349fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/jobs/trophy_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ class TrophyJob < ApplicationJob
queue_as :default

def perform(profile)
Trigger.where('description LIKE ?', 'trophy:%').each do |trigger|
Trigger.where('description LIKE ?', 'trophy:%').order(description: :asc).each do |trigger|
next if trigger.conditions.empty?
trigger.perform(profile, 'trophy')
end
rescue Trigger::TriggerError => e
Rails.logger.error(e)
raise e
rescue StandardError => e
Rails.logger.error(e)
raise e
end
end

0 comments on commit 69349fe

Please sign in to comment.