diff --git a/src/entities/InterchangeSystem.ts b/src/entities/InterchangeSystem.ts index 9fb4bba..efe30cd 100644 --- a/src/entities/InterchangeSystem.ts +++ b/src/entities/InterchangeSystem.ts @@ -39,13 +39,15 @@ export class InterchangeSystem { * classes are correctly linked, meant for use in development and production. * @param args */ - static build( + static async build( args: InterchangeSystemBuilderArguments, ) { const shuttleRepository = new UnoptimizedInMemoryShuttleRepository(); const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(args.passioSystemId, shuttleRepository); + await shuttleDataLoader.start(); const notificationRepository = new RedisNotificationRepository(); + await notificationRepository.connect(); const notificationScheduler = new ETANotificationScheduler( shuttleRepository, notificationRepository, diff --git a/src/index.ts b/src/index.ts index a169a0c..434cc54 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,7 +42,7 @@ async function main() { } else { systems = await Promise.all(supportedSystems.map( async (systemArguments) => { - return InterchangeSystem.buildForTesting(systemArguments); + return await InterchangeSystem.build(systemArguments); }, )); }