mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 01:53:39 +08:00
8ec7fd84fd
This commit introduces 3 queues for sidekiq "critical" for urgent jobs (weighted at 4x weight) "default" for standard jobs(weighted at 2x weight) "low" for less important jobs "critical jobs" Reset Password emails has been seperated to its own job Heartbeat which is required to keep sidekiq running Test email which needs to return real quick "low priority jobs" Notify mailing list Pull hotlinked images Update gravatar "default" All the rest Note: for people running sidekiq from command line use bin/sidekiq -q critical,4 -q default,2 -q low
21 lines
397 B
Ruby
21 lines
397 B
Ruby
require_dependency 'email/sender'
|
|
|
|
module Jobs
|
|
|
|
# Asynchronously send an email
|
|
class TestEmail < Jobs::Base
|
|
|
|
sidekiq_options queue: 'critical'
|
|
|
|
def execute(args)
|
|
|
|
raise Discourse::InvalidParameters.new(:to_address) unless args[:to_address].present?
|
|
|
|
message = TestMailer.send_test(args[:to_address])
|
|
Email::Sender.new(message, :test_message).send
|
|
end
|
|
|
|
end
|
|
|
|
end
|