From 12f0a411533441005f4a267f36b93acff62f9865 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 7 Apr 2025 13:19:43 -0700 Subject: [PATCH] update builder method and use in index --- src/entities/InterchangeSystem.ts | 4 +++- src/index.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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); }, )); }