From 4bbbf25ef8df51fcc56fe1a09fbd0034c6f41b66 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 27 Apr 2017 21:49:34 +0200 Subject: [PATCH] Use a Concurrent::Array for storing messages in the Buffer This ensures that we can still concurrently add messages without messing with the internal Array. --- lib/rackstash/buffer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rackstash/buffer.rb b/lib/rackstash/buffer.rb index 0eb7ca7..4286a17 100644 --- a/lib/rackstash/buffer.rb +++ b/lib/rackstash/buffer.rb @@ -128,7 +128,7 @@ module Rackstash # # @return [self] def clear - @messages = [] + @messages = Concurrent::Array.new @fields = Rackstash::Fields::Hash.new(forbidden_keys: FORBIDDEN_FIELDS) @tags = Rackstash::Fields::Tags.new @timestamp = nil