arbitre EVCS par WhatsApp, revue de la journee, jour faible et sans EDF dans la fiche
This commit is contained in:
@@ -269,6 +269,9 @@ async function detect() {
|
||||
let alerteEcs = '';
|
||||
try { alerteEcs = await checkAlerteECS(); } catch { /* idem : jamais bloquant */ }
|
||||
if (alerteEcs) alert = [alert, alerteEcs].filter(Boolean).join('\n\n');
|
||||
let arbitrage = '';
|
||||
try { arbitrage = checkArbitrage(); } catch { /* idem : jamais bloquant */ }
|
||||
if (arbitrage) alert = [alert, arbitrage].filter(Boolean).join('\n\n');
|
||||
if (ok) return [transition, question, alert].filter(Boolean).join('\n\n');
|
||||
return [transition, alert].filter(Boolean).join('\n\n'); // panne PG : santé + alerte quand même
|
||||
}
|
||||
@@ -530,6 +533,18 @@ async function checkAlerteECS() {
|
||||
return String(a.message).slice(0, 300);
|
||||
}
|
||||
|
||||
// 08/10/2026, « GO arbitre » : question d'arbitrage d'EVCS (une fois par id) et verdict « repondu » pas encore
|
||||
// relayé. Tout est dans arbitrage.js (seul à écrire la réponse). Tests : SIM.arbitrage → ARBITRAGE_SIMULATION,
|
||||
// sans lui un banc CONCIERGE_SIMULATION ne lit pas l'arbitrage réel.
|
||||
function checkArbitrage() {
|
||||
if (fs.existsSync(ALERT_KILL)) return '';
|
||||
if (SIM && !SIM.arbitrage) return '';
|
||||
const env = SIM ? { ...process.env, ARBITRAGE_SIMULATION: JSON.stringify({ arbitrage: SIM.arbitrage, etat: SIM.arbitrageEtat || {} }) } : process.env;
|
||||
const run = (c) => require('child_process').execFileSync('node', [path.join(__dirname, 'arbitrage.js'), c],
|
||||
{ env, timeout: 30000, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
|
||||
return [run('application'), run('question')].filter(Boolean).join('\n\n');
|
||||
}
|
||||
|
||||
const cmd = process.argv[2];
|
||||
(async () => {
|
||||
let out = '';
|
||||
|
||||
Reference in New Issue
Block a user