PERF: lower the priority on user emails

User emails can wait behind other regular jobs, they are usually somewhat
slower as they involve smtp transactions
This commit is contained in:
Sam 2018-05-22 15:20:55 +10:00
parent 9e2131ace8
commit 24abf38d38

View File

@ -6,6 +6,8 @@ module Jobs
# Asynchronously send an email to a user
class UserEmail < Jobs::Base
sidekiq_options queue: 'low'
def execute(args)
raise Discourse::InvalidParameters.new(:user_id) unless args[:user_id].present?
raise Discourse::InvalidParameters.new(:type) unless args[:type].present?