Optimize fetching full history.

This commit is contained in:
Johannes Mockenhaupt 2017-11-21 00:43:17 +01:00
parent 63607d169d
commit 4b1a774544
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -940,10 +940,10 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
void readAllPumpData() { void readAllPumpData() {
readHistory(new PumpHistoryRequest() readHistory(new PumpHistoryRequest()
.bolusHistory(PumpHistoryRequest.FULL) .bolusHistory(pump.history.bolusHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.bolusHistory.get(0).timestamp)
.tbrHistory(PumpHistoryRequest.FULL) .tbrHistory(pump.history.tbrHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.tbrHistory.get(0).timestamp)
.pumpErrorHistory(PumpHistoryRequest.FULL) .pumpErrorHistory(pump.history.pumpErrorHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.pumpErrorHistory.get(0).timestamp)
.tddHistory(PumpHistoryRequest.FULL)); .tddHistory(pump.history.tddHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.tddHistory.get(0).timestamp));
CommandResult commandResult = runCommand("Reading basal profile", 2, CommandResult commandResult = runCommand("Reading basal profile", 2,
ruffyScripter::readBasalProfile); ruffyScripter::readBasalProfile);
if (commandResult.success) { if (commandResult.success) {