update method calls in TimedApiBasedShuttleRepositoryLoader

This commit is contained in:
2025-04-06 11:23:27 -07:00
parent 8c2fb3a52a
commit 56466964c1
2 changed files with 8 additions and 10 deletions

View File

@@ -47,15 +47,14 @@ export class TimedApiBasedShuttleRepositoryLoader extends ApiBasedShuttleReposit
if (!this.shouldBeRunning) return; if (!this.shouldBeRunning) return;
try { try {
await this.fetchAndUpdateSystemData(); await this.fetchAndUpdateRouteDataForSystem();
await this.fetchAndUpdateRouteDataForExistingSystemInRepository(); await this.fetchAndUpdateStopAndPolylineDataForRoutesInSystem();
await this.fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemInRepository(); await this.fetchAndUpdateShuttleDataForSystem();
await this.fetchAndUpdateShuttleDataForExistingSystemInRepository();
// Because ETA method doesn't support pruning yet, // Because ETA method doesn't support pruning yet,
// add a call to the clear method here // add a call to the clear method here
await this.repository.clearEtaData(); await this.repository.clearEtaData();
await this.fetchAndUpdateEtaDataForExistingStopsForSystemInRepository(); await this.fetchAndUpdateEtaDataForExistingStopsForSystem();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }

View File

@@ -18,11 +18,10 @@ describe("TimedApiBasedRepositoryLoader", () => {
loader = new TimedApiBasedShuttleRepositoryLoader("1", new UnoptimizedInMemoryShuttleRepository()); loader = new TimedApiBasedShuttleRepositoryLoader("1", new UnoptimizedInMemoryShuttleRepository());
spies = { spies = {
fetchAndUpdateSystemData: jest.spyOn(loader, 'fetchAndUpdateSystemData'), fetchAndUpdateRouteDataForSystem: jest.spyOn(loader, 'fetchAndUpdateRouteDataForSystem'),
fetchAndUpdateRouteDataForExistingSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateRouteDataForExistingSystemInRepository'), fetchAndUpdateStopAndPolylineDataForRoutesInSystem: jest.spyOn(loader, 'fetchAndUpdateStopAndPolylineDataForRoutesInSystem'),
fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemInRepository'), fetchAndUpdateShuttleDataForSystem: jest.spyOn(loader, 'fetchAndUpdateShuttleDataForSystem'),
fetchAndUpdateShuttleDataForExistingSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateShuttleDataForExistingSystemInRepository'), fetchAndUpdateEtaDataForExistingStopsForSystem: jest.spyOn(loader, 'fetchAndUpdateEtaDataForExistingStopsForSystem')
fetchAndUpdateEtaDataForExistingStopsForSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateEtaDataForExistingStopsForSystemInRepository')
}; };
Object.values(spies).forEach((spy: any) => { Object.values(spies).forEach((spy: any) => {