diff --git a/nuxt4/app/components/lotes/Table.vue b/nuxt4/app/components/lotes/Table.vue
index ce9136e..62540f0 100644
--- a/nuxt4/app/components/lotes/Table.vue
+++ b/nuxt4/app/components/lotes/Table.vue
@@ -76,20 +76,20 @@
icon="i-heroicons-eye"
size="xs"
variant="ghost"
- @click="$emit('view', row)"
+ @click="$emit('view', row.original as Lote)"
/>
diff --git a/nuxt4/app/components/operaciones/Table.vue b/nuxt4/app/components/operaciones/Table.vue
index 97b7543..9a9276c 100644
--- a/nuxt4/app/components/operaciones/Table.vue
+++ b/nuxt4/app/components/operaciones/Table.vue
@@ -68,7 +68,7 @@
icon="i-heroicons-eye"
size="xs"
variant="ghost"
- @click="$emit('view', row)"
+ @click="$emit('view', row.original as Operacion)"
/>
diff --git a/nuxt4/server/utils/db.ts b/nuxt4/server/utils/db.ts
index a31f56f..6e7862e 100644
--- a/nuxt4/server/utils/db.ts
+++ b/nuxt4/server/utils/db.ts
@@ -64,7 +64,7 @@ export async function query(
params?: any[]
): Promise> {
const start = Date.now()
- const maxRetries = 2
+ const maxRetries = 5
for (let attempt = 0; attempt <= maxRetries; attempt++) {
const currentPool = getPool()
@@ -86,8 +86,9 @@ export async function query(
console.error('Error ejecutando query:', { text, params, error: error?.message || error, code: error?.code, attempt })
if (shouldRetry) {
- // Pequeño backoff y reintento
- await new Promise((res) => setTimeout(res, 500 * (attempt + 1)))
+ // Backoff progresivo y reintento
+ const delay = Math.min(2000, 300 * (attempt + 1))
+ await new Promise((res) => setTimeout(res, delay))
// Resetear pool en auth/conn error por si la contraseña/estado cambia en caliente
try {
await currentPool.end()