Skip to content

Commit

Permalink
when running in debug mode, *don't* limit Tandem log records to those…
Browse files Browse the repository at this point in the history
… from most recent shut-down
  • Loading branch information
jebeck committed Nov 7, 2015
1 parent 9a5f91e commit 9c81ea7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/drivers/tandemTslimDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* == BSD2 LICENSE ==
*/

/* globals __DEBUG__ */

var _ = require('lodash');
var struct = require('./../struct.js')();
var sundial = require('sundial');
Expand Down Expand Up @@ -1726,12 +1728,14 @@ module.exports = function (config) {
we only attempt to process and upload the data following
the most recent device shut-down.
*/
data.log_records = _.takeRightWhile(data.log_records, function(rec) {
if (rec.change_type && rec.change_type === 'pump_shut_down') {
return false;
}
return true;
});
if (!__DEBUG__) {
data.log_records = _.takeRightWhile(data.log_records, function(rec) {
if (rec.change_type && rec.change_type === 'pump_shut_down') {
return false;
}
return true;
});
}

postrecords = buildSettingsRecords(data, postrecords);
if (!_.isEmpty(postrecords)) {
Expand Down

0 comments on commit 9c81ea7

Please sign in to comment.