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.
This commit is contained in:
2025-11-14 10:49:23 -08:00
parent f8e7670b3f
commit 8621f10721
2 changed files with 10 additions and 10 deletions

View File

@@ -119,17 +119,17 @@ export class InMemorySelfUpdatingETARepository extends BaseInMemoryETARepository
toStopId: nextStop.stopId, toStopId: nextStop.stopId,
}, [ }, [
{ {
from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)), from: twoHoursAgo,
to: oneWeekAgo, to: new Date(),
}, },
{ {
from: new Date(oneDayAgo.getTime() - (twoHoursInMs)), from: new Date(oneDayAgo.getTime() - (twoHoursInMs)),
to: oneDayAgo, to: oneDayAgo,
}, },
{ {
from: twoHoursAgo, from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)),
to: new Date(), to: oneWeekAgo,
} },
]); ]);
if (travelTimeSeconds == undefined) return; if (travelTimeSeconds == undefined) return;

View File

@@ -140,17 +140,17 @@ export class RedisSelfUpdatingETARepository extends BaseRedisETARepository imple
toStopId: nextStop.stopId, toStopId: nextStop.stopId,
}, [ }, [
{ {
from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)), from: twoHoursAgo,
to: oneWeekAgo, to: new Date(),
}, },
{ {
from: new Date(oneDayAgo.getTime() - (twoHoursInMs)), from: new Date(oneDayAgo.getTime() - (twoHoursInMs)),
to: oneDayAgo, to: oneDayAgo,
}, },
{ {
from: twoHoursAgo, from: new Date(oneWeekAgo.getTime() - (twoHoursInMs)),
to: new Date(), to: oneWeekAgo,
} },
]); ]);
if (travelTimeSeconds == undefined) return; if (travelTimeSeconds == undefined) return;