1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-12-20 15:21:12 +00:00

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.
This commit is contained in:
Holger Just 2017-04-27 21:49:34 +02:00
parent e84d372c08
commit 4bbbf25ef8

View File

@ -128,7 +128,7 @@ module Rackstash
# #
# @return [self] # @return [self]
def clear def clear
@messages = [] @messages = Concurrent::Array.new
@fields = Rackstash::Fields::Hash.new(forbidden_keys: FORBIDDEN_FIELDS) @fields = Rackstash::Fields::Hash.new(forbidden_keys: FORBIDDEN_FIELDS)
@tags = Rackstash::Fields::Tags.new @tags = Rackstash::Fields::Tags.new
@timestamp = nil @timestamp = nil