Sophie

Sophie

distrib > Mageia > cauldron > x86_64 > media > core-release-src > by-pkgid > 9a2ede08e9459f6d966d46ab365791ec > files > 1

golang-github-afex-hystrix-0-2.mga9.src.rpm

From 08d68152cb4ec65fa33ebb6c43269e4657325288 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
Date: Sat, 23 Jan 2021 16:34:01 +0100
Subject: [PATCH 1/1] Make compatible with statsd 5.0.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
---
 plugins/statsd_collector.go | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/plugins/statsd_collector.go b/plugins/statsd_collector.go
index 6f835ab..d4a947e 100644
--- a/plugins/statsd_collector.go
+++ b/plugins/statsd_collector.go
@@ -76,7 +76,14 @@ func InitializeStatsdCollector(config *StatsdCollectorConfig) (*StatsdCollectorC
 	c, err := statsd.NewBufferedClient(config.StatsdAddr, config.Prefix, 1*time.Second, flushBytes)
 	if err != nil {
 		log.Printf("Could not initiale buffered client: %s. Falling back to a Noop Statsd client", err)
-		c, _ = statsd.NewNoopClient()
+		// Create noop client
+		var c statsd.Statter
+		cfg := &statsd.ClientConfig{
+			Address: "not-resolvable:8125",
+			Prefix:  "test-client",
+		}
+		c, _ = statsd.NewClientWithConfig(cfg)
+		defer c.Close()
 	}
 	return &StatsdCollectorClient{
 		client:     c,
-- 
2.29.2