mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Don't try to publish messages on broken posts
This commit is contained in:
parent
2920cfc319
commit
d77f218122
@ -93,12 +93,15 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def publish_change_to_clients!(type)
|
def publish_change_to_clients!(type)
|
||||||
|
# special failsafe for posts missing topics
|
||||||
|
# consistency checks should fix, but message
|
||||||
|
# is safe to skip
|
||||||
MessageBus.publish("/topic/#{topic_id}", {
|
MessageBus.publish("/topic/#{topic_id}", {
|
||||||
id: id,
|
id: id,
|
||||||
post_number: post_number,
|
post_number: post_number,
|
||||||
updated_at: Time.now,
|
updated_at: Time.now,
|
||||||
type: type
|
type: type
|
||||||
}, group_ids: topic.secure_group_ids)
|
}, group_ids: topic.secure_group_ids) if topic
|
||||||
end
|
end
|
||||||
|
|
||||||
def trash!(trashed_by=nil)
|
def trash!(trashed_by=nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user