seo-generator-server/launch_real.js
2025-09-03 15:29:19 +08:00

54 lines
2.7 KiB
JavaScript

// ========================================
// SCRIPT: launch_real.js
// LANCEMENT SANS TIMEOUT - PROCESSUS COMPLET
// ========================================
const { processRealData } = require('./process_real');
const { logSh } = require('./lib/ErrorReporting'); // Using unified logSh from ErrorReporting
async function launchWithoutTimeout() {
logSh('🚀 === LANCEMENT PROCESSUS COMPLET LIGNE 2 ===', 'INFO'); // Using logSh instead of console.log
logSh('⏱️ SANS TIMEOUT - Laisse le temps au processus', 'INFO'); // Using logSh instead of console.log
logSh('📋 37 éléments à traiter avec 6 LLMs', 'INFO'); // Using logSh instead of console.log
logSh('⏳ Durée estimée: 3-5 minutes', 'INFO'); // Using logSh instead of console.log
logSh('', 'INFO'); // Using logSh instead of console.log
try {
const startTime = Date.now();
const result = await processRealData(2);
const duration = Math.round((Date.now() - startTime) / 1000);
logSh('', 'INFO'); // Using logSh instead of console.log
logSh('🎉 === PROCESSUS TERMINÉ ===', 'INFO'); // Using logSh instead of console.log
logSh(`⏱️ Durée totale: ${duration}s`, 'INFO'); // Using logSh instead of console.log
logSh('📋 Résultat:', 'INFO'); // Using logSh instead of console.log
logSh(` ✅ Success: ${result.success}`, 'INFO'); // Using logSh instead of console.log
logSh(` 📊 Éléments: ${result.elementsGenerated}`, 'INFO'); // Using logSh instead of console.log
logSh(` 📝 Mots: ${result.stats?.wordCount || 'N/A'}`, 'INFO'); // Using logSh instead of console.log
logSh(` 🔍 Validation: ${result.validationReport?.status || 'N/A'}`, 'INFO'); // Using logSh instead of console.log
logSh(` 💾 Article ID: ${result.articleStorage?.articleId || 'N/A'}`, 'INFO'); // Using logSh instead of console.log
if (result.articleStorage?.articleId) {
logSh('', 'INFO'); // Using logSh instead of console.log
logSh('🎯 ARTICLE SAUVÉGARDÉ DANS GOOGLE SHEETS !', 'INFO'); // Using logSh instead of console.log
logSh(' Va voir ton Google Sheet pour l\'article généré', 'INFO'); // Using logSh instead of console.log
}
logSh('', 'INFO'); // Using logSh instead of console.log
logSh('📋 Logs détaillés: logs/seo-generator-2025-08-31.log', 'INFO'); // Using logSh instead of console.log
} catch (error) {
console.error('');
logSh('❌ ERREUR: ' + error.message, 'ERROR'); // Using logSh instead of console.error
logSh('📋 Voir logs pour détails', 'ERROR'); // Using logSh instead of console.error
}
}
// Lancer directement
if (require.main === module) {
launchWithoutTimeout();
}
module.exports = { launchWithoutTimeout };