solved duplicate points error

This commit is contained in:
2026-08-30 13:38:55 +02:00
parent 4c216abb1f
commit 67d8b50333
3 changed files with 33 additions and 6 deletions
+4 -4
View File
@@ -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)