47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using WSAsegasa;
|
|
|
|
|
|
namespace WSAsegasa
|
|
{
|
|
public class Procesos
|
|
{
|
|
public static Configuracion Conf;
|
|
|
|
public static DateTime? HoraUtcUltimaEjecucionProcesos = null;
|
|
private static bool Procesando;
|
|
|
|
public static void Procesar()
|
|
{
|
|
if (!Procesando && (HoraUtcUltimaEjecucionProcesos.HasValue == false || DateTime.UtcNow.Subtract(HoraUtcUltimaEjecucionProcesos.Value).TotalSeconds > Conf.SegundosMinimosEntreProcesos)) ;
|
|
{
|
|
Procesando = true;
|
|
HoraUtcUltimaEjecucionProcesos = DateTime.UtcNow;
|
|
try
|
|
{
|
|
// ProcesosCorreos.EnviaCorreos();
|
|
// Comprobaciones.CompruebaReplica();
|
|
// Comprobaciones.ChequeaColaCorreo();
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
Debug.WriteLine(@"Procesar: EXCEPCIÓN: " + ex.Message + " " + ex.StackTrace);
|
|
}
|
|
finally
|
|
{
|
|
Procesando = false;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|