diff --git a/apps/server/src/infra/sync/strategy/tsp/tsp-sync-migration.service.ts b/apps/server/src/infra/sync/strategy/tsp/tsp-sync-migration.service.ts index 652c4566a5b..0df0fdf47f1 100644 --- a/apps/server/src/infra/sync/strategy/tsp/tsp-sync-migration.service.ts +++ b/apps/server/src/infra/sync/strategy/tsp/tsp-sync-migration.service.ts @@ -117,7 +117,7 @@ export class TspSyncMigrationService { private getOldIdBatches(oldToNewMappings: Map): string[][] { const oldIds = Array.from(oldToNewMappings.keys()); - const batchSize = this.configService.getOrThrow('TSP_SYNC_MIGRATION_LIMIT'); + const batchSize = this.configService.getOrThrow('TSP_SYNC_MIGRATION_LIMIT', { infer: true }); const batchCount = Math.ceil(oldIds.length / batchSize); const batches: string[][] = []; diff --git a/apps/server/src/infra/sync/strategy/tsp/tsp-sync.strategy.ts b/apps/server/src/infra/sync/strategy/tsp/tsp-sync.strategy.ts index 1586ba2d8e0..ce4d8e56920 100644 --- a/apps/server/src/infra/sync/strategy/tsp/tsp-sync.strategy.ts +++ b/apps/server/src/infra/sync/strategy/tsp/tsp-sync.strategy.ts @@ -50,7 +50,7 @@ export class TspSyncStrategy extends SyncStrategy { const schools = await this.tspSyncService.findSchoolsForSystem(system); - if (this.configService.getOrThrow('FEATURE_TSP_MIGRATION_ENABLED')) { + if (this.configService.getOrThrow('FEATURE_TSP_MIGRATION_ENABLED', { infer: true })) { await this.runMigration(system); } @@ -58,11 +58,11 @@ export class TspSyncStrategy extends SyncStrategy { } private async syncSchools(system: System): Promise { - const schoolDaysToFetch = this.configService.getOrThrow('TSP_SYNC_SCHOOL_DAYS_TO_FETCH'); + const schoolDaysToFetch = this.configService.getOrThrow('TSP_SYNC_SCHOOL_DAYS_TO_FETCH', { infer: true }); const tspSchools = await this.tspFetchService.fetchTspSchools(system, schoolDaysToFetch); this.logger.info(new TspSchoolsFetchedLoggable(tspSchools.length, schoolDaysToFetch)); - const schoolLimit = this.configService.getOrThrow('TSP_SYNC_SCHOOL_LIMIT'); + const schoolLimit = this.configService.getOrThrow('TSP_SYNC_SCHOOL_LIMIT', { infer: true }); const schoolLimitFn = pLimit(schoolLimit); const schoolPromises = tspSchools.map((tspSchool) => @@ -100,7 +100,7 @@ export class TspSyncStrategy extends SyncStrategy { } private async syncData(system: System, schools: School[]): Promise { - const schoolDataDaysToFetch = this.configService.getOrThrow('TSP_SYNC_DATA_DAYS_TO_FETCH'); + const schoolDataDaysToFetch = this.configService.getOrThrow('TSP_SYNC_DATA_DAYS_TO_FETCH', { infer: true }); const tspTeachers = await this.tspFetchService.fetchTspTeachers(system, schoolDataDaysToFetch); const tspStudents = await this.tspFetchService.fetchTspStudents(system, schoolDataDaysToFetch); const tspClasses = await this.tspFetchService.fetchTspClasses(system, schoolDataDaysToFetch); @@ -118,7 +118,7 @@ export class TspSyncStrategy extends SyncStrategy { this.logger.info(new TspSyncingUsersLoggable(oauthDataDtos.length)); - const dataLimit = this.configService.getOrThrow('TSP_SYNC_DATA_LIMIT'); + const dataLimit = this.configService.getOrThrow('TSP_SYNC_DATA_LIMIT', { infer: true }); const dataLimitFn = pLimit(dataLimit); const dataPromises = oauthDataDtos.map((oauthDataDto) =>