Change SHUTTLE_WILL_ARRIVE_AT_STOP to return payload of last stop and current stop, to avoid data race

This commit is contained in:
2025-11-13 18:52:13 -08:00
parent 0cf2a4d2e7
commit d6ad90ee7a
6 changed files with 60 additions and 36 deletions

View File

@@ -405,7 +405,10 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt
timestamp: new Date(travelTimeTimestamp),
shuttleId: shuttle.id,
};
this.emit(ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP, shuttleArrival);
this.emit(ShuttleRepositoryEvent.SHUTTLE_WILL_ARRIVE_AT_STOP, {
lastArrival: lastStop,
currentArrival: shuttleArrival,
});
await this.updateShuttleLastStopArrival(shuttleArrival);
}
}