mirror of
https://github.com/meineerde/rackstash.git
synced 2025-12-19 15:01:12 +00:00
Synchronize FilterChain#to_s and FilterChain#inspect
This ensures that any access to the internal @filters array is only done with an aquired lock to ensure data consistency.
This commit is contained in:
parent
f6c5930db6
commit
cbcfec88a8
@ -227,9 +227,11 @@ module Rackstash
|
||||
|
||||
# @return [String] a string representation of `self`
|
||||
def inspect
|
||||
synchronize do
|
||||
id_str = Object.instance_method(:to_s).bind(self).call[2..-2]
|
||||
"#<#{id_str} #{self}>"
|
||||
end
|
||||
end
|
||||
|
||||
# @return [Integer] the number of elements in `self`. May be zero.
|
||||
def length
|
||||
@ -259,7 +261,7 @@ module Rackstash
|
||||
|
||||
# @return [String] an Array-compatible string representation of `self`
|
||||
def to_s
|
||||
@filters.to_s
|
||||
synchronize { @filters.to_s }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user