4bfc7592a6
- Solo registra "caída" cuando ffmpeg sale en <25s (error real: DNS, 403, auth, stall) - Timeouts de sesión del proveedor (~2 min) NO se registran como fallos — son normales - "Recuperado" se registra cuando el stream vuelve a funcionar tras un fallo real - Añade clasificación automática de causa: conexión rechazada, DNS, 403, timeout... - Dashboard: "reinicios" ahora distingue sesiones del proveedor (gris, normal) vs fallos (rojo) - Registro: nueva columna "Duración fallo", proveedor+dominio juntos, filas con color de fondo - StreamEvent: campo pump_duration_secs para persistir duración del fallo o interrupción Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
891 B
Python
18 lines
891 B
Python
from sqlalchemy import Column, BigInteger, Integer, String, Text, DateTime, func
|
|
from ..database import Base
|
|
|
|
|
|
class StreamEvent(Base):
|
|
__tablename__ = "stream_events"
|
|
|
|
id = Column(BigInteger, primary_key=True, index=True)
|
|
channel_id = Column(Integer, nullable=True, index=True)
|
|
channel_name = Column(String(500), nullable=True)
|
|
provider_name = Column(String(200), nullable=True)
|
|
event_type = Column(String(50), nullable=False, index=True) # caida | recuperado
|
|
domain = Column(String(300), nullable=True)
|
|
error_message = Column(Text, nullable=True)
|
|
attempt_number = Column(Integer, nullable=True)
|
|
pump_duration_secs = Column(Integer, nullable=True) # seconds ffmpeg ran (caída) or outage length (recuperado)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now(), index=True)
|