FEATURE: Add a trigger for plugins to include their own jobs.

This commit is contained in:
Guo Xiang Tan 2015-09-04 11:35:25 +08:00
parent 8bc7423045
commit cbb86f9bf6
2 changed files with 2 additions and 0 deletions

View File

@ -498,6 +498,7 @@ class Post < ActiveRecord::Base
args[:image_sizes] = image_sizes if image_sizes.present?
args[:invalidate_oneboxes] = true if invalidate_oneboxes.present?
Jobs.enqueue(:process_post, args)
DiscourseEvent.trigger(:after_trigger_post_process, self)
end
def self.public_posts_count_per_day(start_date, end_date, category_id=nil)

View File

@ -75,6 +75,7 @@ describe PostCreator do
DiscourseEvent.expects(:trigger).with(:post_created, anything, anything, user).once
DiscourseEvent.expects(:trigger).with(:after_validate_topic, anything, anything).once
DiscourseEvent.expects(:trigger).with(:before_create_topic, anything, anything).once
DiscourseEvent.expects(:trigger).with(:after_trigger_post_process, anything).once
creator.create
end