From 24abf38d38fe6414a65cd41f34587b8c9cbb8ad3 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 22 May 2018 15:20:55 +1000 Subject: [PATCH] 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 --- app/jobs/regular/user_email.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/jobs/regular/user_email.rb b/app/jobs/regular/user_email.rb index 0eeea9ecbb5..ac7e1d58d09 100644 --- a/app/jobs/regular/user_email.rb +++ b/app/jobs/regular/user_email.rb @@ -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?