[rrd4j] Improved the interpolation workaround (#17437)

Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
This commit is contained in:
joerg1985 2024-09-18 19:39:22 +02:00 committed by GitHub
parent ce039300b6
commit 5a3a0c0ea2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);