From 8621f10721cf9845a28162ce367af95ed70d2f83 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Fri, 14 Nov 2025 10:49:23 -0800 Subject: [PATCH] Switch the order of fallbacks (previous 2h first) Data from the current day is more representative of current traffic conditions than the same data from a previous day. --- .../shuttle/eta/InMemorySelfUpdatingETARepository.ts | 10 +++++----- .../shuttle/eta/RedisSelfUpdatingETARepository.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/repositories/shuttle/eta/InMemorySelfUpdatingETARepository.ts b/src/repositories/shuttle/eta/InMemorySelfUpdatingETARepository.ts index 868178f..89212ab 100644 --- a/src/repositories/shuttle/eta/InMemorySelfUpdatingETARepository.ts +++ b/src/repositories/shuttle/eta/InMemorySelfUpdatingETARepository.ts @@ -119,17 +119,17 @@ export class InMemorySelfUpdatingETARepository extends BaseInMemoryETARepository toStopId: nextStop.stopId, }, [ { - from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)), - to: oneWeekAgo, + from: twoHoursAgo, + to: new Date(), }, { from: new Date(oneDayAgo.getTime() - (twoHoursInMs)), to: oneDayAgo, }, { - from: twoHoursAgo, - to: new Date(), - } + from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)), + to: oneWeekAgo, + }, ]); if (travelTimeSeconds == undefined) return; diff --git a/src/repositories/shuttle/eta/RedisSelfUpdatingETARepository.ts b/src/repositories/shuttle/eta/RedisSelfUpdatingETARepository.ts index 0514ec2..76e723b 100644 --- a/src/repositories/shuttle/eta/RedisSelfUpdatingETARepository.ts +++ b/src/repositories/shuttle/eta/RedisSelfUpdatingETARepository.ts @@ -140,17 +140,17 @@ export class RedisSelfUpdatingETARepository extends BaseRedisETARepository imple toStopId: nextStop.stopId, }, [ { - from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)), - to: oneWeekAgo, + from: twoHoursAgo, + to: new Date(), }, { from: new Date(oneDayAgo.getTime() - (twoHoursInMs)), to: oneDayAgo, }, { - from: twoHoursAgo, - to: new Date(), - } + from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)), + to: oneWeekAgo, + }, ]); if (travelTimeSeconds == undefined) return;