From c4dd176ab3f871a4a18bf98530e719d42d7e26c1 Mon Sep 17 00:00:00 2001 From: Dave Shawley Date: Mon, 2 Sep 2019 08:30:08 -0400 Subject: [PATCH] Remove unnecessary "on connect" callback. This was removed in Tornado 6 when many of the other callbacks were removed. This was using the callback as the server hostname for SNI purposes. Luckily we aren't using SSL sockets here ;) --- sprockets/mixins/metrics/statsd.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sprockets/mixins/metrics/statsd.py b/sprockets/mixins/metrics/statsd.py index de737de..d71fa2b 100644 --- a/sprockets/mixins/metrics/statsd.py +++ b/sprockets/mixins/metrics/statsd.py @@ -128,7 +128,7 @@ class StatsDCollector: """ sock = iostream.IOStream(socket.socket( socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)) - sock.connect(self._address, self._tcp_on_connected) + sock.connect(self._address) sock.set_close_callback(self._tcp_on_closed) return sock @@ -139,10 +139,6 @@ class StatsDCollector: await asyncio.sleep(self._tcp_reconnect_sleep) self._sock = self._tcp_socket() - def _tcp_on_connected(self): - """Invoked when the IOStream is connected""" - LOGGER.debug('Connected to statsd at %s via TCP', self._address) - def send(self, path, value, metric_type): """Send a metric to Statsd.