Swap start_ts and end_ts comparison to correctly break chunks after 5 minutes

This commit is contained in:
James Allen 2016-10-11 11:01:50 +01:00
parent a197c0d148
commit 694be95e66

View file

@ -235,7 +235,9 @@ module.exports = UpdatesManager =
# a new summarized update next timge, hence we monitor the previous update. # a new summarized update next timge, hence we monitor the previous update.
if previousUpdateWasBigDelete if previousUpdateWasBigDelete
shouldConcat = false shouldConcat = false
else if earliestUpdate and earliestUpdate.meta.start_ts - update.meta.end_ts < @TIME_BETWEEN_DISTINCT_UPDATES else if earliestUpdate and earliestUpdate.meta.end_ts - update.meta.start_ts < @TIME_BETWEEN_DISTINCT_UPDATES
# We're going backwards in time through the updates, so only combine if this update starts less than 5 minutes before
# the end of current summarized block, so no block spans more than 5 minutes.
shouldConcat = true shouldConcat = true
isBigDelete = false isBigDelete = false