mejorando la trazabilidad
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
This commit is contained in:
@@ -76,20 +76,20 @@
|
||||
icon="i-heroicons-eye"
|
||||
size="xs"
|
||||
variant="ghost"
|
||||
@click="$emit('view', row)"
|
||||
@click="$emit('view', row.original as Lote)"
|
||||
/>
|
||||
<UButton
|
||||
icon="i-heroicons-pencil"
|
||||
size="xs"
|
||||
variant="ghost"
|
||||
@click="$emit('edit', row)"
|
||||
@click="$emit('edit', row.original as Lote)"
|
||||
/>
|
||||
<UButton
|
||||
icon="i-heroicons-chart-bar"
|
||||
size="xs"
|
||||
variant="ghost"
|
||||
color="green"
|
||||
@click="$emit('trazabilidad', row)"
|
||||
@click="$emit('trazabilidad', row.original as Lote)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
icon="i-heroicons-eye"
|
||||
size="xs"
|
||||
variant="ghost"
|
||||
@click="$emit('view', row)"
|
||||
@click="$emit('view', row.original as Operacion)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -64,7 +64,7 @@ export async function query<T = any>(
|
||||
params?: any[]
|
||||
): Promise<pg.QueryResult<T>> {
|
||||
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<T = any>(
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user