mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 10:32:45 +08:00
DEV: Ensure consistency in PostCreator hook order (#30668)
Previously we would enqueue sidekiq jobs like `PostProcessCooked` **before** triggering the `topic_created` and `post_created` DiscourseEvents. That means that, depending on the speed/availability of Sidekiq, PostProcessCooked might start running on another host before the DiscourseEvents have been executed. This commit moves the event triggers before enqueue_jobs, so that ordering is guaranteed to be consistent, regardless of Sidekiq performance.
This commit is contained in:
parent
138b02448b
commit
adb4715109
|
@ -214,11 +214,11 @@ class PostCreator
|
||||||
publish
|
publish
|
||||||
|
|
||||||
track_latest_on_category
|
track_latest_on_category
|
||||||
|
trigger_after_events unless opts[:skip_events]
|
||||||
|
|
||||||
enqueue_jobs unless @opts[:skip_jobs]
|
enqueue_jobs unless @opts[:skip_jobs]
|
||||||
BadgeGranter.queue_badge_grant(Badge::Trigger::PostRevision, post: @post)
|
BadgeGranter.queue_badge_grant(Badge::Trigger::PostRevision, post: @post)
|
||||||
|
|
||||||
trigger_after_events unless opts[:skip_events]
|
|
||||||
|
|
||||||
auto_close
|
auto_close
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user