mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
call methods to clear data
This commit is contained in:
@@ -48,6 +48,7 @@ export class RepositoryDataLoader {
|
|||||||
if (!this.shouldBeRunning) return;
|
if (!this.shouldBeRunning) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
await this.clearAllData();
|
||||||
await this.fetchAndUpdateSystemData();
|
await this.fetchAndUpdateSystemData();
|
||||||
await this.fetchAndUpdateRouteDataForExistingSystems();
|
await this.fetchAndUpdateRouteDataForExistingSystems();
|
||||||
await this.fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystems();
|
await this.fetchAndUpdateStopAndPolylineDataForRoutesInExistingSystems();
|
||||||
@@ -60,6 +61,15 @@ export class RepositoryDataLoader {
|
|||||||
this.timer = setTimeout(this.startFetchDataAndUpdate, timeout);
|
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() {
|
private async fetchAndUpdateSystemData() {
|
||||||
const params = {
|
const params = {
|
||||||
getSystems: "2",
|
getSystems: "2",
|
||||||
|
|||||||
Reference in New Issue
Block a user