Update connection error handling to not be Linux specific.
Austin S. Hemmelgarn committed
Jun 6, 2018 at 07:36 UTC
327cb9e20fde644d59a38889f7c0060e4e391577
2 files changed
+2
-10
python.d/boinc.chart.py
+1
-9
@@ -121,9 +121,6 @@ class Service(SimpleService):
121
self.alive = False
122
123
def check(self):
124
- if platform.system() != 'Linux':
125
- self.error('Only supported on Linux.')
126
- return False
124
return self.connect()
125
126
def connect(self):
@@ -138,12 +135,7 @@ class Service(SimpleService):
135
return self.connect()
136
137
def is_alive(self):
141
- # TODO: This final check should ideally not be needed, but the
142
- # boinc_client code does not currenlty handle remote disconnects
143
- # gracefully in a threaded environment. This is the only thing
144
- # making this module Linux specific.
145
- if (not self.alive) or \
146
- self.client.rpc.sock.getsockopt(socket.IPPROTO_TCP, socket.TCP_INFO, 0) != 1:
138
+ if not self.alive:
139
return self.reconnect()
140
return True
141
python.d/python_modules/third_party/boinc_client.py
+1
-1
@@ -21,7 +21,7 @@ GUI_RPC_PASSWD_FILE = "/var/lib/boinc/gui_rpc_auth.cfg"
21
22
GUI_RPC_HOSTNAME = None # localhost
23
GUI_RPC_PORT = 31416
24
-GUI_RPC_TIMEOUT = 30
24
+GUI_RPC_TIMEOUT = 1
25
26
class Rpc(object):
27
''' Class to perform GUI RPC calls to a BOINC core client.