mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Move tmp directory creation from server to initializer
This commit is contained in:
@@ -44,10 +44,6 @@ end
|
||||
puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}"
|
||||
puts "=> Rails #{Rails.version} application starting on http://#{options[:Host]}:#{options[:Port]}}"
|
||||
|
||||
%w(cache pids sessions sockets).each do |dir_to_make|
|
||||
FileUtils.mkdir_p(File.join(RAILS_ROOT, 'tmp', dir_to_make))
|
||||
end
|
||||
|
||||
if options[:detach]
|
||||
Process.daemon
|
||||
pid = "#{RAILS_ROOT}/tmp/pids/server.pid"
|
||||
|
||||
@@ -195,6 +195,13 @@ module Rails
|
||||
plugin_loader.add_plugin_load_paths
|
||||
end
|
||||
|
||||
# Create tmp directories
|
||||
Initializer.default.add :ensure_tmp_directories_exist do
|
||||
%w(cache pids sessions sockets).each do |dir_to_make|
|
||||
FileUtils.mkdir_p(File.join(configuration.root_path, 'tmp', dir_to_make))
|
||||
end
|
||||
end
|
||||
|
||||
# Loads the environment specified by Configuration#environment_path, which
|
||||
# is typically one of development, test, or production.
|
||||
Initializer.default.add :load_environment do
|
||||
|
||||
Reference in New Issue
Block a user