mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: Add ENV variable for enabling MiniProfiler snapshots (#10690)
* DEV: Add ENV variable for enabling MiniProfiler snapshots * MiniProfiler is not loaded in test env
This commit is contained in:
@ -31,6 +31,7 @@ class ApplicationController < ActionController::Base
|
||||
before_action :check_readonly_mode
|
||||
before_action :handle_theme
|
||||
before_action :set_current_user_for_logs
|
||||
before_action :set_mp_snapshot_fields
|
||||
before_action :clear_notifications
|
||||
around_action :with_resolved_locale
|
||||
before_action :set_mobile_view
|
||||
@ -295,6 +296,12 @@ class ApplicationController < ActionController::Base
|
||||
response.headers["X-Discourse-Route"] = "#{controller_name}/#{action_name}"
|
||||
end
|
||||
|
||||
def set_mp_snapshot_fields
|
||||
if defined?(Rack::MiniProfiler)
|
||||
Rack::MiniProfiler.add_snapshot_custom_field("application version", Discourse.git_version)
|
||||
end
|
||||
end
|
||||
|
||||
def clear_notifications
|
||||
if current_user && !@readonly_mode
|
||||
|
||||
|
Reference in New Issue
Block a user