Skip to content

Commit

Permalink
skip processing no basal events
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoglom committed Oct 1, 2024
1 parent 018c6d2 commit 8c2f41c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tconnectsync/sync/tandemsource/process_basal.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ def process(self, events, time_start, time_end):
for event in sorted(events, key=lambda x: x.eventTimestamp):
if last_upload_time and arrow.get(event.eventTimestamp) <= last_upload_time:
if self.pretend:
logger.info("Skipping basal event before last upload time: %s (time range: %s - %s)" % (event, time_start, time_end))
logger.info("Skipping basal event not after last upload time: %s (time range: %s - %s)" % (event, time_start, time_end))
continue

with_duration.append([event.eventTimestamp, None, event])

if not with_duration:
logger.info("No basal events found to process")
return []

for i in range(len(with_duration)-1):
with_duration[i][1] = with_duration[i+1][0] - with_duration[i][0]

Expand Down

0 comments on commit 8c2f41c

Please sign in to comment.