update builder method and use in index

This commit is contained in:
2025-04-07 13:19:43 -07:00
parent 34765a0f3b
commit 12f0a41153
2 changed files with 4 additions and 2 deletions

View File

@@ -39,13 +39,15 @@ export class InterchangeSystem {
* classes are correctly linked, meant for use in development and production. * classes are correctly linked, meant for use in development and production.
* @param args * @param args
*/ */
static build( static async build(
args: InterchangeSystemBuilderArguments, args: InterchangeSystemBuilderArguments,
) { ) {
const shuttleRepository = new UnoptimizedInMemoryShuttleRepository(); const shuttleRepository = new UnoptimizedInMemoryShuttleRepository();
const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(args.passioSystemId, shuttleRepository); const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(args.passioSystemId, shuttleRepository);
await shuttleDataLoader.start();
const notificationRepository = new RedisNotificationRepository(); const notificationRepository = new RedisNotificationRepository();
await notificationRepository.connect();
const notificationScheduler = new ETANotificationScheduler( const notificationScheduler = new ETANotificationScheduler(
shuttleRepository, shuttleRepository,
notificationRepository, notificationRepository,

View File

@@ -42,7 +42,7 @@ async function main() {
} else { } else {
systems = await Promise.all(supportedSystems.map( systems = await Promise.all(supportedSystems.map(
async (systemArguments) => { async (systemArguments) => {
return InterchangeSystem.buildForTesting(systemArguments); return await InterchangeSystem.build(systemArguments);
}, },
)); ));
} }