line 123 - currentTs is undefined if no changes found. add logic to check for 0 changes and set oplogSeconds to 0 oplogSeconds = (currentTs.as_datetime()-startTs.as_datetime()).total_seconds()