mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
DEV: Apply syntax_tree formatting to script/*
This commit is contained in:
@ -2,22 +2,30 @@
|
||||
|
||||
# simple script to measure memory at boot
|
||||
|
||||
if ENV['RAILS_ENV'] != "production"
|
||||
exec "RAILS_ENV=production ruby #{__FILE__}"
|
||||
end
|
||||
exec "RAILS_ENV=production ruby #{__FILE__}" if ENV["RAILS_ENV"] != "production"
|
||||
|
||||
require 'memory_profiler'
|
||||
require "memory_profiler"
|
||||
|
||||
MemoryProfiler.report do
|
||||
require File.expand_path("../../config/environment", __FILE__)
|
||||
MemoryProfiler
|
||||
.report do
|
||||
require File.expand_path("../../config/environment", __FILE__)
|
||||
|
||||
Rails.application.routes.recognize_path('abc') rescue nil
|
||||
begin
|
||||
Rails.application.routes.recognize_path("abc")
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
|
||||
# load up the yaml for the localization bits, in master process
|
||||
I18n.t(:posts)
|
||||
# load up the yaml for the localization bits, in master process
|
||||
I18n.t(:posts)
|
||||
|
||||
# load up all models and schema
|
||||
(ActiveRecord::Base.connection.tables - %w[schema_migrations versions]).each do |table|
|
||||
table.classify.constantize.first rescue nil
|
||||
# load up all models and schema
|
||||
(ActiveRecord::Base.connection.tables - %w[schema_migrations versions]).each do |table|
|
||||
begin
|
||||
table.classify.constantize.first
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end.pretty_print
|
||||
.pretty_print
|
||||
|
Reference in New Issue
Block a user