This commit is contained in:
2022-12-16 06:01:23 +00:00
parent 26c2ae5cc9
commit effd96143f
310 changed files with 48715 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using System;
using Microsoft.Extensions.Logging;
using Sockeye.Util;
using System.Threading.Tasks;
namespace Sockeye.Biz
{
/// <summary>
/// called by Generator to kill report generation processor stuck in limbo (chromium at this time)
/// </summary>
internal static class CoreJobReportRenderEngineProcessCleanup
{
private static ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger("CoreJobReportRenderEngineProcessCleanup");
private static DateTime _lastRun = DateTime.UtcNow;
//SET LOW INTENTIONALLY AS CAN EAT UP A LOT OF RESOURCES QUICKLY IF RUN'S PAST TIME
private static TimeSpan tsRunEvery = new TimeSpan(0, 0, 20);//every twenty seconds run the cleanup task
////////////////////////////////////////////////////////////////////////////////////////////////
//
//
public static async Task DoWork()
{
if (DateUtil.IsAfterDuration(_lastRun, tsRunEvery))
{
log.LogTrace("Checking for expired report jobs");
await Util.ReportRenderManager.KillExpiredRenders(log);
var now = DateTime.UtcNow;
_lastRun = now;
}
}
/////////////////////////////////////////////////////////////////////
}//eoc
}//eons