mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +00:00
Pass down the new arguments into the shuttle repositories
This commit is contained in:
@@ -23,6 +23,7 @@ import { RedisExternalSourceETARepository } from "../repositories/shuttle/eta/Re
|
||||
import { InMemorySelfUpdatingETARepository } from "../repositories/shuttle/eta/InMemorySelfUpdatingETARepository";
|
||||
import { BaseRedisETARepository } from "../repositories/shuttle/eta/BaseRedisETARepository";
|
||||
import { BaseInMemoryETARepository } from "../repositories/shuttle/eta/BaseInMemoryETARepository";
|
||||
import createRedisClientForRepository from "../helpers/createRedisClientForRepository";
|
||||
|
||||
export interface InterchangeSystemBuilderArguments {
|
||||
name: string;
|
||||
@@ -112,7 +113,11 @@ export class InterchangeSystem {
|
||||
}
|
||||
|
||||
private static async buildRedisShuttleLoaderAndRepositories(args: InterchangeSystemBuilderArguments) {
|
||||
const shuttleRepository = new RedisShuttleRepository();
|
||||
const shuttleRepository = new RedisShuttleRepository(
|
||||
createRedisClientForRepository(),
|
||||
args.shuttleStopArrivalDegreeDelta,
|
||||
args.shuttleStopNearbyDegreeDelta,
|
||||
);
|
||||
await shuttleRepository.connect();
|
||||
|
||||
let etaRepository: BaseRedisETARepository;
|
||||
@@ -261,7 +266,10 @@ export class InterchangeSystem {
|
||||
}
|
||||
|
||||
private static buildInMemoryShuttleLoaderAndRepositories(args: InterchangeSystemBuilderArguments) {
|
||||
const shuttleRepository = new UnoptimizedInMemoryShuttleRepository();
|
||||
const shuttleRepository = new UnoptimizedInMemoryShuttleRepository(
|
||||
args.shuttleStopArrivalDegreeDelta,
|
||||
args.shuttleStopNearbyDegreeDelta,
|
||||
);
|
||||
|
||||
let etaRepository: BaseInMemoryETARepository;
|
||||
let shuttleDataLoader: ApiBasedShuttleRepositoryLoader;
|
||||
|
||||
Reference in New Issue
Block a user