1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

Use Arry.new(n) {...} instead of n.times.map {...}

This commit is contained in:
Holger Just 2017-07-12 12:26:56 +02:00
parent 0d1ad5e170
commit 0cf89200f2

View File

@ -133,7 +133,7 @@ describe Rackstash::Adapters::File do
# http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/ # http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/
it 'writes atomic log lines' do it 'writes atomic log lines' do
if Concurrent.on_cruby? if Concurrent.on_cruby?
worker_processes = workers.times.map { |worker_id| worker_processes = Array.new(workers) { |worker_id|
Process.fork do Process.fork do
run_worker worker_id run_worker worker_id
end end
@ -142,7 +142,7 @@ describe Rackstash::Adapters::File do
Process.wait(pid) Process.wait(pid)
end end
else else
worker_threads = workers.times.map { |worker_id| worker_threads = Array.new(workers) { |worker_id|
Thread.new do Thread.new do
run_worker worker_id run_worker worker_id
end end