Change one-hour windows to two hours

A set of shuttles may only make a complete set of trips in two hours, so this should capture more data when calculating ETAs.
This commit is contained in:
2025-11-14 10:34:48 -08:00
parent b2ebd3df9c
commit 397eb2b588

View File

@@ -133,6 +133,7 @@ export class RedisSelfUpdatingETARepository extends BaseRedisETARepository imple
const oneDayAgo = new Date(referenceCurrentTime.getTime() - (60 * 60 * 24 * 1000));
const twoHoursAgo = new Date(referenceCurrentTime.getTime() - (120 * 60 * 1000));
const twoHoursMs = 120 * 60 * 1000;
const travelTimeSeconds = await this.getAverageTravelTimeSecondsWithFallbacks({
routeId: shuttle.routeId,
fromStopId: currentStop.stopId,
@@ -140,11 +141,11 @@ export class RedisSelfUpdatingETARepository extends BaseRedisETARepository imple
}, [
{
from: oneWeekAgo,
to: new Date(oneWeekAgo.getTime() + (60 * 60 * 1000))
to: new Date(oneWeekAgo.getTime() + (twoHoursMs))
},
{
from: oneDayAgo,
to: new Date(oneDayAgo.getTime() + (60 * 60 * 1000))
to: new Date(oneDayAgo.getTime() + (twoHoursMs))
},
{
from: twoHoursAgo,