mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Refactor updateShuttleLastStopArrival to use shuttle ID
This commit is contained in:
@@ -486,7 +486,7 @@ export class RedisShuttleRepository extends EventEmitter implements ShuttleGette
|
||||
await this.addTravelTimeDataPoint({ routeId, fromStopId, toStopId, }, travelTimeSeconds, travelTimeTimestamp);
|
||||
}
|
||||
|
||||
await this.updateShuttleLastStopArrival(shuttle, {
|
||||
await this.updateShuttleLastStopArrival(shuttle.id, {
|
||||
stopId: arrivedStop.id,
|
||||
timestamp: new Date(travelTimeTimestamp),
|
||||
})
|
||||
@@ -626,8 +626,8 @@ export class RedisShuttleRepository extends EventEmitter implements ShuttleGette
|
||||
};
|
||||
}
|
||||
|
||||
public async updateShuttleLastStopArrival(shuttle: IShuttle, lastStopArrival: ShuttleStopArrival) {
|
||||
const key = this.createShuttleLastStopKey(shuttle.id);
|
||||
public async updateShuttleLastStopArrival(shuttleId: string, lastStopArrival: ShuttleStopArrival) {
|
||||
const key = this.createShuttleLastStopKey(shuttleId);
|
||||
await this.redisClient.hSet(key, {
|
||||
stopId: lastStopArrival.stopId,
|
||||
timestamp: lastStopArrival.timestamp.toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user