Compare commits

..

No commits in common. '15c7d638aa86c58bdb80c943d39df50bd1eb9ba3' and 'de9bfba9aad3de18902c0b0fa76f496ba05cded9' have entirely different histories.

@ -9,7 +9,6 @@ export class MaintenanceService {
private static _lastRestartAttempt: number = 0;
private static _lastEvolutionState: string | null = null;
private static _lastStateChangeTs: number = 0;
private static readonly _processStartSec: number = Math.floor(Date.now() / 1000);
private static get retentionDays(): number {
const v = Number(process.env.GROUP_MEMBERS_INACTIVE_RETENTION_DAYS);
@ -161,8 +160,8 @@ export class MaintenanceService {
// Logging solo en primer muestreo o cuando cambie
if (!prev) {
console.log(`[HealthCheck] Estado inicial de la instancia '${instance}': ${newState}`);
this._lastStateChangeTs = this._processStartSec;
try { Metrics.set('evolution_instance_last_state_change_ts', this._processStartSec, { instance: String(instance || '') }); } catch {}
this._lastStateChangeTs = nowSec;
try { Metrics.set('evolution_instance_last_state_change_ts', nowSec, { instance: String(instance || '') }); } catch {}
} else if (prev !== newState) {
console.log(`[HealthCheck] Cambio de estado en instancia '${instance}': ${prev}${newState}`);
this._lastStateChangeTs = nowSec;
@ -173,9 +172,6 @@ export class MaintenanceService {
}
this._lastEvolutionState = newState;
try {
Metrics.set('evolution_instance_state_age_seconds', Math.max(0, nowSec - this._lastStateChangeTs), { instance: String(instance || '') });
} catch {}
};
try {

@ -31,7 +31,7 @@ describe('CommandService - comando desconocido devuelve ayuda rápida', () => {
const msg = res[0].message;
expect(msg).toContain('COMANDO NO RECONOCIDO');
expect(msg).toContain('/t info');
expect(msg).toContain('/t ayuda');
expect(msg).toContain('/t mias');
expect(msg).toContain('/t web');
expect(msg).toContain('/t configurar');

Loading…
Cancel
Save