Send graphite data from within a thread

...so that if it fails, it doesn't kill our whole processing thread
This commit is contained in:
Scott Schneider 2013-11-13 13:31:17 -08:00
parent c80cac8def
commit 3239ea29bd

View file

@ -8,9 +8,11 @@ class Graphite
end end
def log path, value def log path, value
Thread.new {
socket = TCPSocket.new(@server, 2003) socket = TCPSocket.new(@server, 2003)
socket.puts "#{path} #{value} #{Time.now.to_i}" socket.puts "#{path} #{value} #{Time.now.to_i}"
socket.close socket.close
}
end end
end end