This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using AyaNova.Util;
|
||||
|
||||
|
||||
namespace AyaNova.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 = AyaNova.Util.ApplicationLogging.CreateLogger("CoreJobReportRenderEngineProcessCleanup");
|
||||
|
||||
private static DateTime _lastRun = DateTime.UtcNow;
|
||||
private static TimeSpan tsRunEvery = new TimeSpan(0, 5, 1);//every this minutes run the cleanup task
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
public static void DoWork()
|
||||
{
|
||||
if (DateUtil.IsAfterDuration(_lastRun, tsRunEvery))
|
||||
{
|
||||
log.LogTrace("Checking for expired processes");
|
||||
Util.ReportRenderManager.KillExpiredRenders(log);
|
||||
//FileUtil.CleanTemporaryFilesFolder(new TimeSpan(0,5,0));//erase any files found to be older than 5 minutes
|
||||
var now = DateTime.UtcNow;
|
||||
_lastRun = now;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
}//eoc
|
||||
}//eons
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AyaNova.Biz
|
||||
private static ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("CoreJobTempFolderCleanup");
|
||||
|
||||
private static DateTime _lastRun = DateTime.UtcNow;
|
||||
private static TimeSpan tsRunEvery = new TimeSpan(0, 0, 1);//every this minutes run the cleanup task
|
||||
private static TimeSpan tsRunEvery = new TimeSpan(0, 5, 2);//every this minutes run the cleanup task
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -23,7 +23,7 @@ namespace AyaNova.Biz
|
||||
if (DateUtil.IsAfterDuration(_lastRun, tsRunEvery))
|
||||
{
|
||||
log.LogTrace("Temp cleanup now");
|
||||
FileUtil.CleanTemporaryFilesFolder(new TimeSpan(0,5,0));//erase any files found to be older than 5 minutes
|
||||
FileUtil.CleanTemporaryFilesFolder(new TimeSpan(0,15,0));//erase any files found to be older than 15 minutes (which coincides with max report rendering timeout)
|
||||
var now = DateTime.UtcNow;
|
||||
_lastRun = now;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user