Merge pull request #38 from insales/fix_system_command_hanging

Запускаем системные команды с таймаутом 30с
This commit is contained in:
Dmitry Borisov
2021-11-29 14:43:00 +03:00
committed by GitHub

View File

@@ -107,7 +107,7 @@ module Paperclip
command = %Q<#{%Q[#{path_for_command(cmd)} #{params}].gsub(/\s+/, " ")}>
command = "#{command} 2>#{bit_bucket}" if Paperclip.options[:swallow_stderr]
Paperclip.log(command) if Paperclip.options[:log_command]
output = `#{command}`
output = `timeout 30 #{command}`
unless [expected_outcodes].flatten.include?($?.exitstatus)
raise PaperclipCommandLineError, "Error while running #{cmd}"
end