[rrd4j] Improved the interpolation workaround (#17437)

Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
joerg1985 2024-09-18 19:39:22 +02:00 committed by Ciprian Pascu
parent 067a8e3f58
commit 89de130929

View File

@ -373,7 +373,7 @@ public class RRD4jPersistenceService implements QueryablePersistenceService {
if (timestamp - 1 > db.getLastUpdateTime()) {
// only do it if there is not already a value
double lastValue = db.getLastDatasourceValue(DATASOURCE_STATE);
if (!Double.isNaN(lastValue)) {
if (!Double.isNaN(lastValue) && lastValue != value) {
Sample sample = db.createSample();
sample.setTime(timestamp - 1);
sample.setValue(DATASOURCE_STATE, lastValue);