From a80e8cb9bdf657e366c1f4211284babeaf715ec0 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Wed, 6 Jul 2016 13:04:08 +0530 Subject: [PATCH] FIX: do not execute onceoff badge queries if the badges are disabled --- app/jobs/onceoff/grand_first_reply_by_email.rb | 1 + app/jobs/onceoff/grant_emoji.rb | 1 + app/jobs/onceoff/grant_onebox.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/jobs/onceoff/grand_first_reply_by_email.rb b/app/jobs/onceoff/grand_first_reply_by_email.rb index 12fbb86e567..1d97091eb6b 100644 --- a/app/jobs/onceoff/grand_first_reply_by_email.rb +++ b/app/jobs/onceoff/grand_first_reply_by_email.rb @@ -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) diff --git a/app/jobs/onceoff/grant_emoji.rb b/app/jobs/onceoff/grant_emoji.rb index 3b9608ec578..a5feabef16f 100644 --- a/app/jobs/onceoff/grant_emoji.rb +++ b/app/jobs/onceoff/grant_emoji.rb @@ -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) diff --git a/app/jobs/onceoff/grant_onebox.rb b/app/jobs/onceoff/grant_onebox.rb index 3dadbd16d3c..9ce0f6fd00f 100644 --- a/app/jobs/onceoff/grant_onebox.rb +++ b/app/jobs/onceoff/grant_onebox.rb @@ -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)