mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
chore: added parallel static data refresh
This commit is contained in:
@@ -59,9 +59,11 @@ export const useApiStore = defineStore('apiStore', {
|
|||||||
async updateTick(t: number) {
|
async updateTick(t: number) {
|
||||||
// Static data refresh
|
// Static data refresh
|
||||||
if (t >= this.nextDataCheckTime) {
|
if (t >= this.nextDataCheckTime) {
|
||||||
await this.fetchStationsGeneralInfo();
|
await Promise.all([
|
||||||
await this.fetchVehiclesInfo();
|
this.fetchStationsGeneralInfo(),
|
||||||
await this.fetchDonatorsData();
|
this.fetchVehiclesInfo(),
|
||||||
|
this.fetchDonatorsData()
|
||||||
|
]);
|
||||||
|
|
||||||
this.nextDataCheckTime = t + 3600000;
|
this.nextDataCheckTime = t + 3600000;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user