mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
speed up cache directory creation
Let Rake control the cache directories. If the directory already exists, rake will skip creating it (vs the previous task which would always try to mkdir_p)
This commit is contained in:
parent
52f90ea66f
commit
621e079290
1 changed files with 9 additions and 3 deletions
|
@ -2,10 +2,16 @@ namespace :tmp do
|
|||
desc "Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sockets:clear)"
|
||||
task :clear => [ "tmp:sessions:clear", "tmp:cache:clear", "tmp:sockets:clear"]
|
||||
|
||||
tmp_dirs = [ 'tmp/sessions',
|
||||
'tmp/cache',
|
||||
'tmp/sockets',
|
||||
'tmp/pids',
|
||||
'tmp/cache/assets' ]
|
||||
|
||||
tmp_dirs.each { |d| dir d }
|
||||
|
||||
desc "Creates tmp directories for sessions, cache, sockets, and pids"
|
||||
task :create do
|
||||
FileUtils.mkdir_p(%w( tmp/sessions tmp/cache tmp/sockets tmp/pids tmp/cache/assets ))
|
||||
end
|
||||
task :create => tmp_dirs
|
||||
|
||||
namespace :sessions do
|
||||
# desc "Clears all files in tmp/sessions"
|
||||
|
|
Loading…
Reference in a new issue