@cryptotaxi247 / netdata-1 / commits / 20b4ddf27

beanstalk module: configurable timeout option added

lgz committed Nov 3, 2017 at 07:56 UTC 20b4ddf27c9aa01df1f075fa6ed229a184ccf01b
1 file changed +4 -1
python.d/beanstalk.chart.py
+4 -1
@@ -236,9 +236,12 @@ class Service(SimpleService):
236 def connect(self):
237 host = self.configuration.get('host', '127.0.0.1')
238 port = self.configuration.get('port', 11300)
239 + timeout = self.configuration.get('timeout', 1)
240 try:
241 return beanstalkc.Connection(host=host,
241 - port=port)
242 + port=port,
243 + connect_timeout=timeout,
244 + parse_yaml=yaml.load)
245 except beanstalkc.SocketError as error:
246 self.error('Connection to {0}:{1} failed: {2}'.format(host, port, error))
247 return None