A platform for community discussion. Free, open, simple.
add timings to asset precompile
Samd1b21aa73bd1
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rakeindex 6dcdbf88bf1..4acfff11160 100644--- a/lib/tasks/assets.rake+++ b/lib/tasks/assets.rake@@ -110,7 +110,7 @@ enddef gzip(path)STDERR.puts "gzip -f -c -9 #{path} > #{path}.gz"- STDERR.puts `gzip -f -c -9 #{path} > #{path}.gz`+ STDERR.puts `gzip -f -c -9 #{path} > #{path}.gz`.stripraise "gzip compression failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0end@@ -137,7 +137,7 @@ def brotli(path)STDERR.puts brotli_command(path)STDERR.puts `#{brotli_command(path)}`raise "brotli compression failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0- STDERR.puts `chmod +r #{path}.br`+ STDERR.puts `chmod +r #{path}.br`.stripraise "chmod failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0endend@@ -179,9 +179,10 @@ task 'assets:precompile' => 'assets:precompile:before' doif File.exists?(_path)STDERR.puts "Skipping: #{file} already compressed"else- STDERR.puts "Compressing: #{file}"-proc.call do+ start = Time.now+ STDERR.puts "#{start} Compressing: #{file}"+# We can specify some files to never minifyunless (ENV["DONT_MINIFY"] == "1") || to_skip.include?(info['logical_path'])FileUtils.mv(path, _path)@@ -192,6 +193,9 @@ task 'assets:precompile' => 'assets:precompile:before' doinfo["mtime"] = File.mtime(path).iso8601gzip(path)brotli(path)++ STDERR.puts "Done compressing #{file} : #{(Time.now - start).round(2)} secs"+ STDERR.putsendendend