Skip to content

Commit

Permalink
Rebased
Browse files Browse the repository at this point in the history
Signed-off-by: clinique <gael@lhopital.org>
  • Loading branch information
clinique committed Mar 23, 2024
1 parent 51038d4 commit 38e7e26
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void proceedWithUpdate() {
handler.proceedWithUpdate();
long delay;
if (!ThingStatus.ONLINE.equals(thing.getStatus())) {
logger.debug("Module is not ONLINE; refresh stopped");
logger.debug("Module is not ONLINE, refresh stopped");
dataTimeStamp0 = Instant.MIN;
delay = 0;
} else {
Expand All @@ -97,20 +97,20 @@ private void proceedWithUpdate() {
@Override
protected void updateNAThing(NAThing newData) {
super.updateNAThing(newData);
newData.getLastSeen().map(ZonedDateTime::toInstant).ifPresent(tsInstant -> {
newData.getLastSeen().map(ZonedDateTime::toInstant).ifPresent(lastSeen -> {
if (probing()) {
if (Instant.MIN.equals(dataTimeStamp0)) {
dataTimeStamp0 = tsInstant;
dataTimeStamp0 = lastSeen;
logger.debug("First data timestamp is {}", dataTimeStamp0);
} else if (tsInstant.isAfter(dataTimeStamp0)) {
dataValidity = Duration.between(dataTimeStamp0, tsInstant);
} else if (lastSeen.isAfter(dataTimeStamp0)) {
dataValidity = Duration.between(dataTimeStamp0, lastSeen);
refreshConfigured = true;
logger.debug("Data validity period identified to be {}", dataValidity);
} else {
logger.debug("Data validity period not yet found, data timestamp unchanged");
}
}
dataTimeStamp = tsInstant;
dataTimeStamp = lastSeen;
});
}

Expand Down

0 comments on commit 38e7e26

Please sign in to comment.