solved duplicate points error
This commit is contained in:
@@ -20,14 +20,15 @@ class Collector:
|
||||
|
||||
def collect_once(self) -> int:
|
||||
samples = extract_samples(self.client.stations_data(), self.module_names)
|
||||
updated = 0
|
||||
for name, sample in samples.items():
|
||||
try:
|
||||
self.store.update(name, sample)
|
||||
updated += bool(self.store.update(name, sample))
|
||||
except Exception:
|
||||
# One stale/duplicate module must not discard the other modules.
|
||||
LOG.exception("Could not update %s RRD", name)
|
||||
LOG.info("Collected %d Netatmo modules", len(samples))
|
||||
return len(samples)
|
||||
LOG.info("Collected %d Netatmo modules; updated %d RRDs", len(samples), updated)
|
||||
return updated
|
||||
|
||||
def start(self) -> None:
|
||||
if self._thread and self._thread.is_alive():
|
||||
@@ -48,4 +49,3 @@ class Collector:
|
||||
LOG.exception("Netatmo collection failed")
|
||||
remaining = max(1, self.interval - (time.monotonic() - started))
|
||||
self._stop.wait(remaining)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user