Cambios mensajes

This commit is contained in:
2026-04-29 09:11:56 +02:00
parent cd2e8b8530
commit 444b15679d
13 changed files with 2545 additions and 2292 deletions

View File

@@ -0,0 +1,43 @@
using Servicio_Gestion_Asegasa.Procesos;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Servicio_Gestion_Asegasa
{
public class ProcesosConf
{
public static Configuracion Conf;
public static DateTime? HoraUtcUltimaEjecucionProcesos = null;
private static bool Procesando;
public static async Task ProcesarAsync()
{
if (!Procesando && (HoraUtcUltimaEjecucionProcesos.HasValue == false || DateTime.UtcNow.Subtract(HoraUtcUltimaEjecucionProcesos.Value).TotalSeconds > Conf.SegundosMinimosEntreProcesos))
{
Procesando = true;
HoraUtcUltimaEjecucionProcesos = DateTime.UtcNow;
try
{
await ProcesosMensajes.EnviaSMSAsync();
}
catch (Exception ex)
{
Debug.WriteLine(@"Procesar: EXCEPCIÓN: " + ex.Message + " " + ex.StackTrace);
}
finally
{
Procesando = false;
}
}
}
}
}