A platform for community discussion. Free, open, simple.
PERF: run ImageMagick conversions with nice 10
Sam7e4a43afc664
diff --git a/app/models/optimized_image.rb b/app/models/optimized_image.rbindex 2b5f9864e86..5e67cb84047 100644--- a/app/models/optimized_image.rb+++ b/app/models/optimized_image.rb@@ -330,7 +330,7 @@ class OptimizedImage < ActiveRecord::BaseMAX_PNGQUANT_SIZE = 500_000def self.convert_with(instructions, to, opts = {})- Discourse::Utils.execute_command(*instructions)+ Discourse::Utils.execute_command("nice", "-n", "10", *instructions)allow_pngquant = to.downcase.ends_with?(".png") && File.size(to) < MAX_PNGQUANT_SIZEFileHelper.optimize_image!(to, allow_pngquant: allow_pngquant)