Skip to content

Commit

Permalink
NSC: log BG records with wrong timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosKozak committed Dec 26, 2024
1 parent 6a67061 commit c090990
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class KeepAliveWorker(
}

override suspend fun doWorkAndLog(): Result {
aapsLogger.debug(LTag.CORE, "KeepAlive received from: " + inputData.getString("schedule"))
aapsLogger.debug(LTag.CORE, "KeepAlive received from: " + inputData.getString("schedule") + " Thread count: " + Thread.activeCount())

// 15 min interval is WorkManager minimum so schedule another instances to have 5 min interval
if (inputData.getString("schedule") == KA_0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class NsIncomingDataProcessor @Inject constructor(
if (sgv.timestamp < dateUtil.now() + T.mins(1).msecs() && sgv.timestamp > latestDateInReceivedData) {
latestDateInReceivedData = sgv.timestamp
glucoseValues += sgv
}
} else
aapsLogger.debug(LTag.NSCLIENT, "Ignoring record with wrong timestamp: $sgv")
}
} else if (sgvs is List<*>) { // V3 client

Expand All @@ -115,7 +116,8 @@ class NsIncomingDataProcessor @Inject constructor(
if (sgv.timestamp < dateUtil.now() && sgv.timestamp > latestDateInReceivedData) {
latestDateInReceivedData = sgv.timestamp
glucoseValues += sgv
}
} else
aapsLogger.debug(LTag.NSCLIENT, "Ignoring record with wrong timestamp: $sgv")
}
}
if (glucoseValues.isNotEmpty()) {
Expand Down

0 comments on commit c090990

Please sign in to comment.