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 d341c13
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/jobs/trophy_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ 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|
logger.info("Trigger: #{trigger.description}")
next if trigger.conditions.empty?

trigger.perform(profile, 'trophy')
end
rescue Trigger::TriggerError, StandardError => e
logger.error(e)
raise e
end
end

0 comments on commit d341c13

Please sign in to comment.