From 39bac5b36c9f4bfb20e934c63a257424bc1a9ba9 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 27 May 2014 16:08:47 -0400 Subject: [PATCH] FIX: don't create digestless css files in production. With multisite setup, it's keeps getting swapped out for the current site, which is slow and pointless. Digestless css files are for auto-reload of css in dev env --- lib/sass/discourse_stylesheets.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sass/discourse_stylesheets.rb b/lib/sass/discourse_stylesheets.rb index 1eee15afebc..9b99241ad92 100644 --- a/lib/sass/discourse_stylesheets.rb +++ b/lib/sass/discourse_stylesheets.rb @@ -45,7 +45,8 @@ class DiscourseStylesheets end def ensure_digestless_file - unless File.exist?(stylesheet_fullpath_no_digest) && File.mtime(stylesheet_fullpath) == File.mtime(stylesheet_fullpath_no_digest) + # file without digest is only for auto-reloading css in dev env + unless Rails.env.production? || (File.exist?(stylesheet_fullpath_no_digest) && File.mtime(stylesheet_fullpath) == File.mtime(stylesheet_fullpath_no_digest)) FileUtils.cp(stylesheet_fullpath, stylesheet_fullpath_no_digest) end end