feat: optimización integral y auditoría de rendimiento SIBU 2.0.1
This commit is contained in:
@ -15,6 +15,7 @@ export const useBusStopStore = defineStore('busStop', () => {
|
||||
const CACHE_TIME = 1000 * 60 * 30; // 30 minutos
|
||||
const now = Date.now();
|
||||
|
||||
if (isLoading.value) return;
|
||||
if (!force && busStops.value.length > 0 && (now - lastFetched.value < CACHE_TIME)) {
|
||||
return
|
||||
}
|
||||
@ -33,6 +34,7 @@ export const useBusStopStore = defineStore('busStop', () => {
|
||||
}
|
||||
|
||||
async function loadBusStopById(id: string, force = false) {
|
||||
if (isLoading.value) return;
|
||||
// Buscar en cache primero
|
||||
if (!force && busStops.value.length > 0) {
|
||||
const cachedStop = busStops.value.find(s => s.id === id);
|
||||
|
||||
Reference in New Issue
Block a user