mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 09:03:40 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
19 lines
396 B
Ruby
19 lines
396 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_dependency 'post_alerter'
|
|
|
|
module Jobs
|
|
class PostAlert < Jobs::Base
|
|
|
|
def execute(args)
|
|
post = Post.find_by(id: args[:post_id])
|
|
if post&.topic && post.raw.present?
|
|
opts = args[:options] || {}
|
|
new_record = true == args[:new_record]
|
|
PostAlerter.new(opts).after_save_post(post, new_record)
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|