FEATURE: add hook after all initializers

FEATURE: add hook after all initializers

This hook allows plugins to amend middleware stack or any other settings that need to be changed just after the intializers run

diff --git a/config/initializers/300-perf.rb b/config/initializers/300-perf.rb
index 3186698..86822bf 100644
--- a/config/initializers/300-perf.rb
+++ b/config/initializers/300-perf.rb
@@ -10,3 +10,6 @@ if Rails.env == "production"
   # Micro bench shows for `User.first` this takes us from 3.3k/s to 3.5k/s
   ActiveSupport::Notifications.notifier.unsubscribe("sql.active_record")
 end
+
+# this hook can be used by plugins to amend the middleware stack or patch any initializer behavior
+DiscourseEvent.trigger(:after_initializers)

GitHub sha: 208c6389

1 Like