mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Implement clearing of last stop data
This commit is contained in:
@@ -566,6 +566,7 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt
|
|||||||
if (keys.length > 0) {
|
if (keys.length > 0) {
|
||||||
await this.redisClient.del(keys);
|
await this.redisClient.del(keys);
|
||||||
}
|
}
|
||||||
|
await this.clearShuttleLastStopData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async clearOrderedStopData(): Promise<void> {
|
public async clearOrderedStopData(): Promise<void> {
|
||||||
@@ -588,4 +589,11 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt
|
|||||||
await this.redisClient.del(keys);
|
await this.redisClient.del(keys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async clearShuttleLastStopData(): Promise<void> {
|
||||||
|
const keys = await this.redisClient.keys('shuttle:laststop:*');
|
||||||
|
if (keys.length > 0) {
|
||||||
|
await this.redisClient.del(keys);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ export class UnoptimizedInMemoryShuttleRepository
|
|||||||
|
|
||||||
public async clearShuttleData(): Promise<void> {
|
public async clearShuttleData(): Promise<void> {
|
||||||
this.shuttles = [];
|
this.shuttles = [];
|
||||||
|
await this.clearShuttleLastStopData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async clearOrderedStopData(): Promise<void> {
|
public async clearOrderedStopData(): Promise<void> {
|
||||||
@@ -298,4 +299,7 @@ export class UnoptimizedInMemoryShuttleRepository
|
|||||||
this.stops = [];
|
this.stops = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async clearShuttleLastStopData(): Promise<void> {
|
||||||
|
this.shuttleLastStopArrivals.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user