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;
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user