FIX: do not execute onceoff badge queries if the badges are disabled

This commit is contained in:
Arpit Jalan 2016-07-06 13:04:08 +05:30
parent aa16f043ea
commit a80e8cb9bd
3 changed files with 3 additions and 0 deletions

View file

@ -2,6 +2,7 @@ module Jobs
class GrantFirstReplyByEmail < Jobs::Onceoff
def execute_onceoff(args)
return unless SiteSetting.enable_badges
to_award = {}
Post.select(:id, :created_at, :user_id)

View file

@ -2,6 +2,7 @@ module Jobs
class GrantEmoji < Jobs::Onceoff
def execute_onceoff(args)
return unless SiteSetting.enable_badges
to_award = {}
Post.secured(Guardian.new)

View file

@ -4,6 +4,7 @@ module Jobs
sidekiq_options queue: 'low'
def execute_onceoff(args)
return unless SiteSetting.enable_badges
to_award = {}
Post.secured(Guardian.new)