From c2f1a67a7075ea488cc68dd2bc5fee23f1d16c44 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Fri, 21 Nov 2025 10:39:08 -0800 Subject: [PATCH] Remove unused ETA code from RedisShuttleRepository --- .../shuttle/RedisShuttleRepository.ts | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/src/repositories/shuttle/RedisShuttleRepository.ts b/src/repositories/shuttle/RedisShuttleRepository.ts index 9098f56..ab41196 100644 --- a/src/repositories/shuttle/RedisShuttleRepository.ts +++ b/src/repositories/shuttle/RedisShuttleRepository.ts @@ -87,7 +87,6 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt private createStopKey = (stopId: string) => `shuttle:stop:${stopId}`; private createRouteKey = (routeId: string) => `shuttle:route:${routeId}`; private createShuttleKey = (shuttleId: string) => `shuttle:shuttle:${shuttleId}`; - private createEtaKey = (shuttleId: string, stopId: string) => `shuttle:eta:${shuttleId}:${stopId}`; private createOrderedStopKey = (routeId: string, stopId: string) => `shuttle:orderedstop:${routeId}:${stopId}`; private createShuttleLastStopKey = (shuttleId: string) => `shuttle:laststop:${shuttleId}`; private createHistoricalEtaTimeSeriesKey = (routeId: string, fromStopId: string, toStopId: string) => { @@ -308,45 +307,6 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt return this.createShuttleFromRedisData(data); } - public async getEtasForShuttleId(shuttleId: string): Promise { - const keys = await this.redisClient.keys(`shuttle:eta:${shuttleId}:*`); - const etas: IEta[] = []; - - for (const key of keys) { - const data = await this.redisClient.hGetAll(key); - if (Object.keys(data).length > 0) { - etas.push(this.createEtaFromRedisData(data)); - } - } - - return etas; - } - - public async getEtasForStopId(stopId: string): Promise { - const keys = await this.redisClient.keys('shuttle:eta:*'); - const etas: IEta[] = []; - - for (const key of keys) { - const data = await this.redisClient.hGetAll(key); - if (Object.keys(data).length > 0 && data.stopId === stopId) { - etas.push(this.createEtaFromRedisData(data)); - } - } - - return etas; - } - - public async getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise { - const key = this.createEtaKey(shuttleId, stopId); - const data = await this.redisClient.hGetAll(key); - - if (Object.keys(data).length === 0) { - return null; - } - - return this.createEtaFromRedisData(data); - } - public async getOrderedStopByRouteAndStopId(routeId: string, stopId: string): Promise { const key = this.createOrderedStopKey(routeId, stopId); const data = await this.redisClient.hGetAll(key);