feat: optimización integral y auditoría de rendimiento SIBU 2.0.1

This commit is contained in:
2026-03-01 17:35:13 -05:00
parent 66b76cee61
commit 6ae0e7b0bf
14 changed files with 917 additions and 2170 deletions

View File

@ -22,6 +22,9 @@ export const useRouteStore = defineStore('route', () => {
const CACHE_TIME = 1000 * 60 * 15; // 15 minutos
const now = Date.now();
// Guard: Si ya se están cargando rutas, no iniciar otra petición
if (isLoadingRoutes.value) return;
// Si no forzamos, no hay filtros raros, ya tenemos rutas y aún no expira el caché, omitir llamada
if (!force && !filters && allRoutes.value.length > 0 && (now - lastFetched.value < CACHE_TIME)) {
return
@ -44,6 +47,7 @@ export const useRouteStore = defineStore('route', () => {
const CACHE_TIME = 1000 * 60 * 15; // 15 minutos
const now = Date.now();
if (isLoadingStops.value) return;
if (!force && stopsCache.value.has(routeId)) {
const cacheEntry = stopsCache.value.get(routeId)!;
if (now - cacheEntry.fetchedAt < CACHE_TIME) {