Actualizar robot.js
This commit is contained in:
5
robot.js
5
robot.js
@@ -199,8 +199,11 @@ async function runMultiasistencia(ownerId, user, pass, gremiosDB) {
|
|||||||
const expedientes = Array.from(todosExpedientes);
|
const expedientes = Array.from(todosExpedientes);
|
||||||
console.log(`✅ [Multi] Total expedientes detectados: ${expedientes.length}`);
|
console.log(`✅ [Multi] Total expedientes detectados: ${expedientes.length}`);
|
||||||
|
|
||||||
if (expedientes.length > 0) {
|
// 🛑 NUEVO SEGURO DE VIDA: Si lee menos de 5, desconfiamos de la web y NO archivamos nada, por si es un error puntual.
|
||||||
|
if (expedientes.length > 5 || paginaActual === 1) {
|
||||||
await syncAndArchive(ownerId, 'multiasistencia', expedientes);
|
await syncAndArchive(ownerId, 'multiasistencia', expedientes);
|
||||||
|
} else {
|
||||||
|
console.log("⚠️ [Multi] Pocos expedientes detectados. ABORTANDO ARCHIVADO DE SEGURIDAD.");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const ref of expedientes) {
|
for (const ref of expedientes) {
|
||||||
|
|||||||
Reference in New Issue
Block a user