Browse Source

remove tmp/cache

main
pvincent 2 months ago
parent
commit
cf5b47ec20
  1. 1
      bin/dev
  2. 23
      config/initializers/instrumentalizing.rb

1
bin/dev

@ -17,6 +17,7 @@ if [[ -d public/assets ]]; then
echo "-- Press Enter to confirm / Ctrl+C to cancel" echo "-- Press Enter to confirm / Ctrl+C to cancel"
read read
rm -rf public/assets rm -rf public/assets
rm -rf tmp/cache
fi fi
exec foreman start -f Procfile.dev "$@" exec foreman start -f Procfile.dev "$@"

23
config/initializers/instrumentalizing.rb

@ -30,18 +30,28 @@ Rails.configuration.after_initialize do
end end
else else
time_format = '%H:%M:%S' unless Rails.application.procfile_server?
SemanticLogger.clear_appenders! SemanticLogger.clear_appenders!
SemanticLogger.add_appender( SemanticLogger.add_appender(
io: $stdout, io: $stdout,
formatter: Rails.application.config.x.semantic.formatter.constantize.new(time_format:)
formatter: Rails.application.config.x.semantic.formatter.constantize.new(
time_format: Rails.application.procfile_server? ? nil : '%H:%M:%S'
) )
)
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event|
constants = event.payload[:changes].map { |change| change[:constant] }
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any?
Semantic::Instrumentalizer.activate(*build_instrumentation_config)
end
end
Rails.autoloaders.main.on_load('ApplicationController') do Rails.autoloaders.main.on_load('ApplicationController') do
SemanticLogger.clear_appenders! SemanticLogger.clear_appenders!
SemanticLogger.add_appender( SemanticLogger.add_appender(
io: $stdout, io: $stdout,
formatter: Rails.application.config.x.semantic.formatter.constantize.new(time_format:)
formatter: Rails.application.config.x.semantic.formatter.constantize.new(
time_format: Rails.application.procfile_server? ? nil : '%H:%M:%S'
)
) )
Rails.logger.info ' ', dimensions: Semantic::FancyDimensions.new(rails: '╔═╗', before: 1) Rails.logger.info ' ', dimensions: Semantic::FancyDimensions.new(rails: '╔═╗', before: 1)
@ -50,11 +60,6 @@ Rails.configuration.after_initialize do
Semantic::Instrumentalizer.activate(*build_instrumentation_config) Semantic::Instrumentalizer.activate(*build_instrumentation_config)
end end
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event|
constants = event.payload[:changes].map { |change| change[:constant] }
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any?
Semantic::Instrumentalizer.activate(*build_instrumentation_config)
end
end
end end
end end
Loading…
Cancel
Save