call methods to clear data

This commit is contained in:
2025-01-16 21:07:49 -08:00
parent b7a25a6115
commit 6176dd9f5a

View File

@@ -48,6 +48,7 @@ export class RepositoryDataLoader {
if (!this.shouldBeRunning) return;
try {
await this.clearAllData();
await this.fetchAndUpdateSystemData();
await this.fetchAndUpdateRouteDataForExistingSystems();
await this.fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystems();
@@ -60,6 +61,15 @@ export class RepositoryDataLoader {
this.timer = setTimeout(this.startFetchDataAndUpdate, timeout);
}
private async clearAllData() {
await this.repository.clearRouteData();
await this.repository.clearSystemData();
await this.repository.clearEtaData();
await this.repository.clearStopData();
await this.repository.clearOrderedStopData();
await this.repository.clearShuttleData();
}
private async fetchAndUpdateSystemData() {
const params = {
getSystems: "2",