mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-16 23:40:32 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user