mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
update method calls in TimedApiBasedShuttleRepositoryLoader
This commit is contained in:
@@ -47,15 +47,14 @@ export class TimedApiBasedShuttleRepositoryLoader extends ApiBasedShuttleReposit
|
||||
if (!this.shouldBeRunning) return;
|
||||
|
||||
try {
|
||||
await this.fetchAndUpdateSystemData();
|
||||
await this.fetchAndUpdateRouteDataForExistingSystemInRepository();
|
||||
await this.fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemInRepository();
|
||||
await this.fetchAndUpdateShuttleDataForExistingSystemInRepository();
|
||||
await this.fetchAndUpdateRouteDataForSystem();
|
||||
await this.fetchAndUpdateStopAndPolylineDataForRoutesInSystem();
|
||||
await this.fetchAndUpdateShuttleDataForSystem();
|
||||
|
||||
// Because ETA method doesn't support pruning yet,
|
||||
// add a call to the clear method here
|
||||
await this.repository.clearEtaData();
|
||||
await this.fetchAndUpdateEtaDataForExistingStopsForSystemInRepository();
|
||||
await this.fetchAndUpdateEtaDataForExistingStopsForSystem();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,10 @@ describe("TimedApiBasedRepositoryLoader", () => {
|
||||
loader = new TimedApiBasedShuttleRepositoryLoader("1", new UnoptimizedInMemoryShuttleRepository());
|
||||
|
||||
spies = {
|
||||
fetchAndUpdateSystemData: jest.spyOn(loader, 'fetchAndUpdateSystemData'),
|
||||
fetchAndUpdateRouteDataForExistingSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateRouteDataForExistingSystemInRepository'),
|
||||
fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystemInRepository'),
|
||||
fetchAndUpdateShuttleDataForExistingSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateShuttleDataForExistingSystemInRepository'),
|
||||
fetchAndUpdateEtaDataForExistingStopsForSystemsInRepository: jest.spyOn(loader, 'fetchAndUpdateEtaDataForExistingStopsForSystemInRepository')
|
||||
fetchAndUpdateRouteDataForSystem: jest.spyOn(loader, 'fetchAndUpdateRouteDataForSystem'),
|
||||
fetchAndUpdateStopAndPolylineDataForRoutesInSystem: jest.spyOn(loader, 'fetchAndUpdateStopAndPolylineDataForRoutesInSystem'),
|
||||
fetchAndUpdateShuttleDataForSystem: jest.spyOn(loader, 'fetchAndUpdateShuttleDataForSystem'),
|
||||
fetchAndUpdateEtaDataForExistingStopsForSystem: jest.spyOn(loader, 'fetchAndUpdateEtaDataForExistingStopsForSystem')
|
||||
};
|
||||
|
||||
Object.values(spies).forEach((spy: any) => {
|
||||
|
||||
Reference in New Issue
Block a user