mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Prevent shuttle arriving at same stop from firing the SHUTTLE_WILL_ARRIVE_AT_STOP event
This commit is contained in:
@@ -395,7 +395,11 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt
|
||||
) {
|
||||
const arrivedStop = await this.getArrivedStopIfExists(shuttle);
|
||||
|
||||
if (arrivedStop != undefined) {
|
||||
if (arrivedStop) {
|
||||
// stop if same stop
|
||||
const lastStop = await this.getShuttleLastStopArrival(shuttle.id);
|
||||
if (lastStop?.stopId === arrivedStop.id) return;
|
||||
|
||||
const shuttleArrival = {
|
||||
stopId: arrivedStop.id,
|
||||
timestamp: new Date(travelTimeTimestamp),
|
||||
|
||||
Reference in New Issue
Block a user