@cryptotaxi247 / netdata-1 / commits / 038f276e7

SimpleService manage_retries() minor fixes

lgz committed Nov 5, 2017 at 02:53 UTC 038f276e78525ea9ad3eb2c1d18bdc033f2bdc9a
1 file changed +6 -5
python.d/python_modules/bases/FrameworkServices/SimpleService.py
+6 -5
@@ -227,11 +227,12 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec
227 return updated
228
229 def manage_retries(self):
230 - self._runtime_counters.RETRIES += 1
231 - if self._runtime_counters.RETRIES % 5 == 0:
232 - self._runtime_counters.PENALTY = int(self._runtime_counters.RETRIES * self.update_every / 2)
233 - if self._runtime_counters.RETRIES >= self._runtime_counters.RETRIES_MAX:
234 - self.error('stopped after {0} data collection failures in a row'.format(self._runtime_counters.RETRIES_MAX))
230 + rc = self._runtime_counters
231 + rc.RETRIES += 1
232 + if rc.RETRIES % 5 == 0:
233 + rc.PENALTY = int(rc.RETRIES * self.update_every / 2)
234 + if rc.RETRIES >= rc.RETRIES_MAX:
235 + self.error('stopped after {0} data collection failures in a row'.format(rc.RETRIES_MAX))
236 return False
237 return True
238