lib/rails-audit/runner.rb in rails-audit-0.12.0 vs lib/rails-audit/runner.rb in rails-audit-0.12.1
- old
+ new
@@ -42,15 +42,17 @@
def self.run_threads(config)
failures = []
mutex = Mutex.new
- Audits::ALL.map do |audit|
+ threads = Audits::ALL.map do |audit|
Thread.new do
success = audit.run get_config(config, audit.get_name)
mutex.synchronize { failures << audit.get_name unless success }
end
- end.each { |t| t.join }
+ end
+
+ threads.each { |t| t.join }
failures
end
end